Merge pull request '发送需求' (#10) from wuyifan_branch into develop
commit
0d739d8a5a
@ -0,0 +1,41 @@
|
||||
package com.softegg.freetogo.SendDemand.controller;
|
||||
|
||||
import com.softegg.freetogo.SendDemand.service.SendDemandService;
|
||||
import com.softegg.freetogo.Demand.Dao.DemandsRepository;
|
||||
import com.softegg.freetogo.Demand.bean.Demands;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Map;
|
||||
/**
|
||||
* @description:登录服务前后端交互
|
||||
* @author:wuyifan
|
||||
* @date:2024/5/10 23:09
|
||||
*/
|
||||
|
||||
@RestController
|
||||
//@CrossOrigin(origins = "*")
|
||||
@RequestMapping("/SendDemand")
|
||||
public class SendDemandController {
|
||||
|
||||
@Autowired
|
||||
SendDemandService sendDemandService;
|
||||
|
||||
/**
|
||||
* @description: 发送需求的交互逻辑
|
||||
* @param: map
|
||||
* @return: java.lang.String
|
||||
* @author: zhanglinhao
|
||||
* @date: 2024/5/9 22:45
|
||||
*/
|
||||
@PostMapping("register")
|
||||
public int SendDemand(@RequestBody Map<String, Object> map) {
|
||||
return switch (sendDemandService.sendnewDemandAccount(map.get("city").toString(), map.get("phone").toString())){
|
||||
case 1005 -> 1;//需求发送成功
|
||||
default -> 0;
|
||||
};
|
||||
}
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.softegg.freetogo.SendDemand.service;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @description:抽象需求发送服务接口类
|
||||
* @author:wuyifan
|
||||
* @date:2024/5/10 23:31
|
||||
*/
|
||||
@Service
|
||||
public interface SendDemandService {
|
||||
int sendnewDemandAccount(String city, String phone);
|
||||
}
|
Loading…
Reference in new issue