parent
3d84564315
commit
74038d062a
@ -0,0 +1,13 @@
|
|||||||
|
package com.softegg.freetogo.GuideService.Dao;
|
||||||
|
|
||||||
|
import com.softegg.freetogo.GuideService.bean.GuideService;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description:继承Jpa数据库接口类
|
||||||
|
* @author:wuyifan
|
||||||
|
* @date:2024/5/13 9:17
|
||||||
|
*/
|
||||||
|
public interface GuideServiceRepository extends JpaRepository<GuideService, Integer> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,48 @@
|
|||||||
|
package com.softegg.freetogo.GuideService.bean;
|
||||||
|
|
||||||
|
import jakarta.persistence.*;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description:数据库中表guideService的对应实体类
|
||||||
|
* @author:wuyifan
|
||||||
|
* @date:2024/5/13 9:14
|
||||||
|
*/
|
||||||
|
@Entity
|
||||||
|
@Table(name="guideService")
|
||||||
|
@Setter
|
||||||
|
@Getter
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class GuideService {
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Integer uid;
|
||||||
|
@Column
|
||||||
|
private String phone;//导游手机号码
|
||||||
|
@Column
|
||||||
|
private boolean guideGender;//导游性别 ture:male, false:female
|
||||||
|
@Column
|
||||||
|
private String nickname;//发布需求的导游昵称信息
|
||||||
|
@Column
|
||||||
|
private String createTime;//服务发布时间
|
||||||
|
@Column
|
||||||
|
private String departureDate;//导游服务起始日期
|
||||||
|
@Column
|
||||||
|
private String endDate;//导游服务结束日期
|
||||||
|
@Column
|
||||||
|
private String sumDay;//导游服务总天数
|
||||||
|
@Column
|
||||||
|
private String city;//导游服务的目的城市
|
||||||
|
@Column
|
||||||
|
private String message;//导游服务备注内容
|
||||||
|
// @Column
|
||||||
|
// private boolean guideGender;//希望导游性别
|
||||||
|
// @Column
|
||||||
|
// private int status;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,39 @@
|
|||||||
|
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<String, Object> map) {
|
||||||
|
return switch (sendGuideServiceService.sendnewGuideServiceAccount(map.get("city").toString(), map.get("phone").toString())){
|
||||||
|
case 1005 -> 1;//需求发送成功
|
||||||
|
default -> 0;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
package com.softegg.freetogo.SendGuideService.service;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description:抽象需求发送服务接口类
|
||||||
|
* @author:wuyifan
|
||||||
|
* @date:2024/5/13 11:11
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public interface SendGuideServiceService {
|
||||||
|
|
||||||
|
int sendnewGuideServiceAccount(String city, String phone);
|
||||||
|
}
|
Loading…
Reference in new issue