package com.softegg.freetogo.SendGuideService.controller; import com.softegg.freetogo.SendGuideService.service.SendGuideServiceService; 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/13 10:47 */ @RestController //@CrossOrigin(origins = "*") @RequestMapping("/SendGuideService") public class SendGuideServiceController { @Autowired SendGuideServiceService sendGuideServiceService; /** * @description: 发送需求的交互逻辑 * @param: map * @return: java.lang.String * @author: wuyifan * @date: 2024/5/13 10:48 */ @PostMapping("register") public int SendDemand(@RequestBody Map map) { return switch (sendGuideServiceService.sendnewGuideServiceAccount(map.get("city").toString(), map.get("phone").toString())){ case 1005 -> 1;//需求发送成功 default -> 0; }; } }