所有服务接入Nacos服务发现
This commit is contained in:
@@ -2,8 +2,10 @@ package com.cxyxiaomo.epp;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
|
||||
@SpringBootApplication
|
||||
@EnableDiscoveryClient
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
@@ -1,7 +1,7 @@
|
||||
package com.cxyxiaomo.epp.index.controller;
|
||||
|
||||
import com.cxyxiaomo.epp.index.pojo.Apply;
|
||||
import com.cxyxiaomo.epp.index.pojo.Res;
|
||||
import com.cxyxiaomo.epp.pojo.Apply;
|
||||
import com.cxyxiaomo.epp.pojo.Res;
|
||||
import com.cxyxiaomo.epp.index.service.ApplyService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
@@ -1,7 +1,7 @@
|
||||
package com.cxyxiaomo.epp.index.controller;
|
||||
|
||||
import com.cxyxiaomo.epp.index.pojo.Notice;
|
||||
import com.cxyxiaomo.epp.index.pojo.Res;
|
||||
import com.cxyxiaomo.epp.pojo.Notice;
|
||||
import com.cxyxiaomo.epp.pojo.Res;
|
||||
import com.cxyxiaomo.epp.index.service.NoticeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package com.cxyxiaomo.epp.index.controller;
|
||||
|
||||
import com.cxyxiaomo.epp.index.pojo.Res;
|
||||
import com.cxyxiaomo.epp.pojo.Res;
|
||||
import com.cxyxiaomo.epp.index.service.OtherService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
@@ -1,7 +1,7 @@
|
||||
package com.cxyxiaomo.epp.index.controller;
|
||||
|
||||
import com.cxyxiaomo.epp.index.pojo.Report;
|
||||
import com.cxyxiaomo.epp.index.pojo.Res;
|
||||
import com.cxyxiaomo.epp.pojo.Report;
|
||||
import com.cxyxiaomo.epp.pojo.Res;
|
||||
import com.cxyxiaomo.epp.index.service.ReportService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
@@ -1,7 +1,7 @@
|
||||
package com.cxyxiaomo.epp.index.controller;
|
||||
|
||||
import com.cxyxiaomo.epp.index.pojo.Res;
|
||||
import com.cxyxiaomo.epp.index.pojo.User;
|
||||
import com.cxyxiaomo.epp.pojo.Res;
|
||||
import com.cxyxiaomo.epp.pojo.User;
|
||||
import com.cxyxiaomo.epp.index.service.UserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package com.cxyxiaomo.epp.index.dao;
|
||||
|
||||
import com.cxyxiaomo.epp.index.pojo.Apply;
|
||||
import com.cxyxiaomo.epp.pojo.Apply;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package com.cxyxiaomo.epp.index.dao;
|
||||
|
||||
import com.cxyxiaomo.epp.index.pojo.Notice;
|
||||
import com.cxyxiaomo.epp.pojo.Notice;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package com.cxyxiaomo.epp.index.dao;
|
||||
|
||||
import com.cxyxiaomo.epp.index.pojo.Feedback;
|
||||
import com.cxyxiaomo.epp.pojo.Feedback;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package com.cxyxiaomo.epp.index.dao;
|
||||
|
||||
import com.cxyxiaomo.epp.index.pojo.Report;
|
||||
import com.cxyxiaomo.epp.pojo.Report;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package com.cxyxiaomo.epp.index.dao;
|
||||
|
||||
import com.cxyxiaomo.epp.index.pojo.User;
|
||||
import com.cxyxiaomo.epp.pojo.User;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
@@ -1,29 +0,0 @@
|
||||
package com.cxyxiaomo.epp.index.pojo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Apply {
|
||||
|
||||
private Integer id;
|
||||
|
||||
private String name;
|
||||
|
||||
private String stuId;
|
||||
|
||||
private Integer stu_id;
|
||||
|
||||
private String issue;
|
||||
|
||||
private String transport;
|
||||
|
||||
private String place;
|
||||
|
||||
private String start_time;
|
||||
|
||||
private String end_time;
|
||||
|
||||
private Integer state;
|
||||
|
||||
private String create_time;
|
||||
}
|
@@ -1,17 +0,0 @@
|
||||
package com.cxyxiaomo.epp.index.pojo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Feedback {
|
||||
|
||||
private Integer id;
|
||||
|
||||
private String title;
|
||||
|
||||
private String content;
|
||||
|
||||
private String time;
|
||||
|
||||
private String reply;
|
||||
}
|
@@ -1,19 +0,0 @@
|
||||
package com.cxyxiaomo.epp.index.pojo;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
@Data
|
||||
public class Notice {
|
||||
|
||||
private Integer id;
|
||||
|
||||
private String title;
|
||||
|
||||
private String content;
|
||||
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private String time;
|
||||
|
||||
}
|
||||
|
@@ -1,28 +0,0 @@
|
||||
package com.cxyxiaomo.epp.index.pojo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Report {
|
||||
|
||||
private Integer id;
|
||||
|
||||
private Integer user_id;
|
||||
|
||||
private String name;
|
||||
|
||||
private String address;
|
||||
|
||||
private String time;
|
||||
|
||||
private String normal;
|
||||
|
||||
private String yes_noon_temp;
|
||||
|
||||
private String yes_night_temp;
|
||||
|
||||
private String today_morning_temp;
|
||||
|
||||
private String isolation;
|
||||
|
||||
}
|
@@ -1,34 +0,0 @@
|
||||
package com.cxyxiaomo.epp.index.pojo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Res<T> {
|
||||
private String msg;
|
||||
private T data;
|
||||
|
||||
public Res() {
|
||||
}
|
||||
|
||||
public Res(T data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public static Res success(){
|
||||
Res res = new Res<>();
|
||||
res.setMsg("成功");
|
||||
return res;
|
||||
}
|
||||
|
||||
public static <T> Res<T> success(T data){
|
||||
Res<T> res = new Res<>(data);
|
||||
res.setMsg("成功");
|
||||
return res;
|
||||
}
|
||||
|
||||
public static Res error(String msg){
|
||||
Res res = new Res<>();
|
||||
res.setMsg(msg);
|
||||
return res;
|
||||
}
|
||||
}
|
@@ -1,15 +0,0 @@
|
||||
package com.cxyxiaomo.epp.index.pojo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class User {
|
||||
private Integer id;
|
||||
private String username;
|
||||
private String name;
|
||||
private String password;
|
||||
private String img;
|
||||
private String stu_id;
|
||||
private Integer role;
|
||||
private String state;
|
||||
}
|
@@ -1,6 +1,6 @@
|
||||
package com.cxyxiaomo.epp.index.service;
|
||||
|
||||
import com.cxyxiaomo.epp.index.pojo.Apply;
|
||||
import com.cxyxiaomo.epp.pojo.Apply;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
package com.cxyxiaomo.epp.index.service;
|
||||
|
||||
import com.cxyxiaomo.epp.index.dao.ApplyDao;
|
||||
import com.cxyxiaomo.epp.index.pojo.Apply;
|
||||
import com.cxyxiaomo.epp.pojo.Apply;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package com.cxyxiaomo.epp.index.service;
|
||||
|
||||
import com.cxyxiaomo.epp.index.pojo.Notice;
|
||||
import com.cxyxiaomo.epp.pojo.Notice;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
package com.cxyxiaomo.epp.index.service;
|
||||
|
||||
import com.cxyxiaomo.epp.index.dao.NoticeDao;
|
||||
import com.cxyxiaomo.epp.index.pojo.Notice;
|
||||
import com.cxyxiaomo.epp.pojo.Notice;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package com.cxyxiaomo.epp.index.service;
|
||||
|
||||
import com.cxyxiaomo.epp.index.pojo.Feedback;
|
||||
import com.cxyxiaomo.epp.pojo.Feedback;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
package com.cxyxiaomo.epp.index.service;
|
||||
|
||||
import com.cxyxiaomo.epp.index.dao.OtherDao;
|
||||
import com.cxyxiaomo.epp.index.pojo.Feedback;
|
||||
import com.cxyxiaomo.epp.pojo.Feedback;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package com.cxyxiaomo.epp.index.service;
|
||||
|
||||
import com.cxyxiaomo.epp.index.pojo.Report;
|
||||
import com.cxyxiaomo.epp.pojo.Report;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@@ -2,7 +2,7 @@ package com.cxyxiaomo.epp.index.service;
|
||||
|
||||
import com.cxyxiaomo.epp.index.dao.ReportDao;
|
||||
import com.cxyxiaomo.epp.index.dao.UserDao;
|
||||
import com.cxyxiaomo.epp.index.pojo.Report;
|
||||
import com.cxyxiaomo.epp.pojo.Report;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package com.cxyxiaomo.epp.index.service;
|
||||
|
||||
import com.cxyxiaomo.epp.index.pojo.User;
|
||||
import com.cxyxiaomo.epp.pojo.User;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
package com.cxyxiaomo.epp.index.service;
|
||||
|
||||
import com.cxyxiaomo.epp.index.dao.UserDao;
|
||||
import com.cxyxiaomo.epp.index.pojo.User;
|
||||
import com.cxyxiaomo.epp.pojo.User;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
@@ -1,8 +1,8 @@
|
||||
package com.cxyxiaomo.epp.visitor.controller;
|
||||
|
||||
import com.cxyxiaomo.epp.index.pojo.Res;
|
||||
import com.cxyxiaomo.epp.pojo.Res;
|
||||
import com.cxyxiaomo.epp.visitor.service.VisitorService;
|
||||
import com.cxyxiaomo.epp.visitor.pojo.Visitor;
|
||||
import com.cxyxiaomo.epp.pojo.Visitor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package com.cxyxiaomo.epp.visitor.dao;
|
||||
|
||||
import com.cxyxiaomo.epp.visitor.pojo.Visitor;
|
||||
import com.cxyxiaomo.epp.pojo.Visitor;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
@@ -1,22 +0,0 @@
|
||||
package com.cxyxiaomo.epp.visitor.pojo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Visitor {
|
||||
|
||||
private Integer id;
|
||||
|
||||
private String time;
|
||||
|
||||
private String phone;
|
||||
|
||||
private String issue;
|
||||
|
||||
private String meet_name;
|
||||
|
||||
private String create_time;
|
||||
|
||||
private Integer state;
|
||||
|
||||
}
|
@@ -1,6 +1,6 @@
|
||||
package com.cxyxiaomo.epp.visitor.service;
|
||||
|
||||
import com.cxyxiaomo.epp.visitor.pojo.Visitor;
|
||||
import com.cxyxiaomo.epp.pojo.Visitor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package com.cxyxiaomo.epp.visitor.service.impl;
|
||||
|
||||
import com.cxyxiaomo.epp.visitor.pojo.Visitor;
|
||||
import com.cxyxiaomo.epp.pojo.Visitor;
|
||||
import com.cxyxiaomo.epp.visitor.service.VisitorService;
|
||||
import com.cxyxiaomo.epp.visitor.dao.VisitorDao;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@@ -5,6 +5,10 @@ server:
|
||||
spring:
|
||||
application:
|
||||
name: microservice-provider-miniprogram
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
server-addr: 127.0.0.1:8848
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://127.0.0.1:3306/epp?useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&serverTimezone=UTC
|
||||
|
@@ -15,12 +15,12 @@
|
||||
<select id="lastApply" resultType="java.lang.Integer">
|
||||
select * from apply where stu_id = #{id} and state = 0 limit 1
|
||||
</select>
|
||||
<select id="applyListNoReplay" resultType="com.cxyxiaomo.epp.index.pojo.Apply">
|
||||
<select id="applyListNoReplay" resultType="com.cxyxiaomo.epp.pojo.Apply">
|
||||
select a.*,u.name,u.stu_id as stuId from apply a
|
||||
left join user u on a.stu_id = u.id
|
||||
where a.state = 0
|
||||
</select>
|
||||
<select id="myApply" resultType="com.cxyxiaomo.epp.index.pojo.Apply">
|
||||
<select id="myApply" resultType="com.cxyxiaomo.epp.pojo.Apply">
|
||||
select a.*,u.name,u.stu_id as stuId from apply a
|
||||
left join user u on a.stu_id = u.id
|
||||
where a.stu_id = #{id}
|
||||
|
@@ -10,7 +10,7 @@
|
||||
<delete id="delNotice">
|
||||
delete from notice where id = #{id}
|
||||
</delete>
|
||||
<select id="noticeList" resultType="com.cxyxiaomo.epp.index.pojo.Notice">
|
||||
<select id="noticeList" resultType="com.cxyxiaomo.epp.pojo.Notice">
|
||||
select * from notice order by time desc
|
||||
<if test="limit!= ''">
|
||||
limit ${limit}
|
||||
|
@@ -11,7 +11,7 @@
|
||||
update feedback set reply = #{replay}
|
||||
where id = #{id}
|
||||
</update>
|
||||
<select id="feedbackList" resultType="com.cxyxiaomo.epp.index.pojo.Feedback">
|
||||
<select id="feedbackList" resultType="com.cxyxiaomo.epp.pojo.Feedback">
|
||||
select * from feedback
|
||||
<where>
|
||||
<if test="id != null">
|
||||
@@ -19,7 +19,7 @@
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="feedbackListNoReplay" resultType="com.cxyxiaomo.epp.index.pojo.Feedback">
|
||||
<select id="feedbackListNoReplay" resultType="com.cxyxiaomo.epp.pojo.Feedback">
|
||||
select * from feedback where reply is null
|
||||
</select>
|
||||
</mapper>
|
||||
|
@@ -11,7 +11,7 @@
|
||||
(#{user_id},#{name},#{address},#{time},#{normal},#{yes_noon_temp},
|
||||
#{yes_night_temp},#{today_morning_temp},#{isolation})
|
||||
</insert>
|
||||
<select id="myReport" resultType="com.cxyxiaomo.epp.index.pojo.Report">
|
||||
<select id="myReport" resultType="com.cxyxiaomo.epp.pojo.Report">
|
||||
select name,time,normal,address from report where user_id = #{id}
|
||||
order by time desc
|
||||
</select>
|
||||
|
@@ -19,20 +19,20 @@
|
||||
update user set state = #{date}
|
||||
where id = #{id}
|
||||
</update>
|
||||
<select id="selectAll" resultType="com.cxyxiaomo.epp.index.pojo.User">
|
||||
<select id="selectAll" resultType="com.cxyxiaomo.epp.pojo.User">
|
||||
select * from `user`
|
||||
</select>
|
||||
<select id="getUserByUsername" resultType="com.cxyxiaomo.epp.index.pojo.User">
|
||||
<select id="getUserByUsername" resultType="com.cxyxiaomo.epp.pojo.User">
|
||||
select * from user where username = #{username}
|
||||
</select>
|
||||
<select id="getUser" resultType="com.cxyxiaomo.epp.index.pojo.User">
|
||||
<select id="getUser" resultType="com.cxyxiaomo.epp.pojo.User">
|
||||
select * from user where username = #{username} and role_id = #{role}
|
||||
</select>
|
||||
<select id="redCodeList" resultType="com.cxyxiaomo.epp.index.pojo.User">
|
||||
<select id="redCodeList" resultType="com.cxyxiaomo.epp.pojo.User">
|
||||
select name,stu_id from user where TO_DAYS(NOW( )) != TO_DAYS(state) and role = 2
|
||||
</select>
|
||||
|
||||
<select id="redCodeList2" resultType="com.cxyxiaomo.epp.index.pojo.User">
|
||||
<select id="redCodeList2" resultType="com.cxyxiaomo.epp.pojo.User">
|
||||
select name,stu_id from user where state = "1999-01-01"
|
||||
</select>
|
||||
</mapper>
|
||||
|
@@ -19,7 +19,7 @@
|
||||
<select id="showMyVisitor" resultType="java.lang.Integer">
|
||||
select state from visitor where phone = #{phone} and TO_DAYS(NOW( )) - TO_DAYS(time) = 0
|
||||
</select>
|
||||
<select id="showVisitorList" resultType="com.cxyxiaomo.epp.visitor.pojo.Visitor">
|
||||
<select id="showVisitorList" resultType="com.cxyxiaomo.epp.pojo.Visitor">
|
||||
select * from visitor where state = 0
|
||||
</select>
|
||||
</mapper>
|
||||
|
Reference in New Issue
Block a user