From 5e7327ee6ce062b1ec4b3392f4cd38bb6e9138e1 Mon Sep 17 00:00:00 2001 From: Wklizx <wklizxsama@qq.com> Date: Wed, 17 Aug 2022 00:48:48 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=B0=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 11 -- .../irs/controller/ResumeController.java | 3 +- .../controller/StationResumeController.java | 2 +- .../irs/controller/UserController.java | 17 ++- .../sixteam/irs/mapper/EnterpriseMapper.java | 18 ++- .../com/sixteam/irs/mapper/UserMapper.java | 3 +- .../java/com/sixteam/irs/mapper/UserRole.java | 9 -- .../com/sixteam/irs/model/Enterprise.java | 124 ---------------- src/main/java/com/sixteam/irs/model/User.java | 140 ------------------ .../irs/service/EnterpriseService.java | 10 ++ .../irs/service/EnterpriseServiceImpl.java | 25 ---- .../{ => Impl}/EncyclopediaServiceImpl.java | 2 +- .../{ => Impl}/EnterpriceServiceImpl.java | 12 +- .../{ => Impl}/JurisdictionServiceImpl.java | 2 +- .../service/{ => Impl}/ResumeServiceImpl.java | 3 +- .../{ => Impl}/StationResumeServiceImpl.java | 3 +- .../{ => Impl}/StationServiceImpl.java | 2 +- .../service/{ => Impl}/UserServiceImpl.java | 7 +- .../com/sixteam/irs/service/UserService.java | 4 +- .../{ => java/com/sixteam/irs/sql}/shujuku | 0 src/main/resources/application.yml | 4 +- .../sixteam/irs/mapper/EnterpriseMapper.xml | 2 +- .../com/sixteam/irs/mapper/UserMapper.xml | 2 +- .../com/sixteam/irs/mapper/UserRole.xml | 9 -- src/main/resources/templates/index.html | 4 +- 25 files changed, 69 insertions(+), 349 deletions(-) delete mode 100644 src/main/java/com/sixteam/irs/mapper/UserRole.java delete mode 100644 src/main/java/com/sixteam/irs/model/Enterprise.java delete mode 100644 src/main/java/com/sixteam/irs/model/User.java delete mode 100644 src/main/java/com/sixteam/irs/service/EnterpriseServiceImpl.java rename src/main/java/com/sixteam/irs/service/{ => Impl}/EncyclopediaServiceImpl.java (97%) rename src/main/java/com/sixteam/irs/service/{ => Impl}/EnterpriceServiceImpl.java (83%) rename src/main/java/com/sixteam/irs/service/{ => Impl}/JurisdictionServiceImpl.java (95%) rename src/main/java/com/sixteam/irs/service/{ => Impl}/ResumeServiceImpl.java (83%) rename src/main/java/com/sixteam/irs/service/{ => Impl}/StationResumeServiceImpl.java (85%) rename src/main/java/com/sixteam/irs/service/{ => Impl}/StationServiceImpl.java (95%) rename src/main/java/com/sixteam/irs/service/{ => Impl}/UserServiceImpl.java (89%) rename src/main/{ => java/com/sixteam/irs/sql}/shujuku (100%) delete mode 100644 src/main/resources/com/sixteam/irs/mapper/UserRole.xml diff --git a/pom.xml b/pom.xml index 07fcfae..bb5afb7 100644 --- a/pom.xml +++ b/pom.xml @@ -55,12 +55,6 @@ <scope>test</scope> </dependency> - <dependency> - <groupId>com.alibaba</groupId> - <artifactId>druid-spring-boot-starter</artifactId> - <version>1.1.22</version> - </dependency> - <dependency> <groupId>com.github.pagehelper</groupId> <artifactId>pagehelper</artifactId> @@ -79,11 +73,6 @@ <scope>provided</scope> </dependency> - <!--支持jstl-> - - - - <!-servlet开启--> <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> diff --git a/src/main/java/com/sixteam/irs/controller/ResumeController.java b/src/main/java/com/sixteam/irs/controller/ResumeController.java index beaaaf1..ae727ca 100644 --- a/src/main/java/com/sixteam/irs/controller/ResumeController.java +++ b/src/main/java/com/sixteam/irs/controller/ResumeController.java @@ -1,12 +1,11 @@ package com.sixteam.irs.controller; import com.sixteam.irs.entity.Resume; -import com.sixteam.irs.service.ResumeServiceImpl; +import com.sixteam.irs.service.Impl.ResumeServiceImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; -import java.util.ArrayList; import java.util.List; @Controller diff --git a/src/main/java/com/sixteam/irs/controller/StationResumeController.java b/src/main/java/com/sixteam/irs/controller/StationResumeController.java index b03279b..2323689 100644 --- a/src/main/java/com/sixteam/irs/controller/StationResumeController.java +++ b/src/main/java/com/sixteam/irs/controller/StationResumeController.java @@ -1,7 +1,7 @@ package com.sixteam.irs.controller; import com.sixteam.irs.entity.StationResume; -import com.sixteam.irs.service.StationResumeServiceImpl; +import com.sixteam.irs.service.Impl.StationResumeServiceImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; diff --git a/src/main/java/com/sixteam/irs/controller/UserController.java b/src/main/java/com/sixteam/irs/controller/UserController.java index 3d50640..3e0fe88 100644 --- a/src/main/java/com/sixteam/irs/controller/UserController.java +++ b/src/main/java/com/sixteam/irs/controller/UserController.java @@ -1,6 +1,7 @@ package com.sixteam.irs.controller; -import com.sixteam.irs.model.User; + +import com.sixteam.irs.entity.User; import com.sixteam.irs.service.UserService; import com.sun.org.apache.xpath.internal.operations.Mod; import org.apache.ibatis.annotations.Insert; @@ -15,13 +16,19 @@ import javax.servlet.http.HttpSession; import java.util.List; @Controller -@RequestMapping("/user") +@RequestMapping("/") public class UserController { @Autowired private UserService userService; - @RequestMapping("findAllUser") + @RequestMapping("") + public String start(){ + System.out.println("启动"); + return "/index.jsp"; + } + + @RequestMapping("/findAllUser") public String findAllUser(Model model){ List<User> userList = userService.findAllUser(); System.out.println(userList); @@ -30,7 +37,7 @@ public class UserController { } - @RequestMapping("findUserByName") + @RequestMapping("/findUserByName") public String findUserByName(Model model,User user){ List<User> userList = userService.findUserByName(user); model.addAttribute("userList",userList); @@ -66,7 +73,7 @@ public class UserController { } - @RequestMapping("toUpdateUser") + @RequestMapping("/toUpdateUser") public String toUpdateUser(User user, Model model, Integer id) { User user1 = userService.findById(user); diff --git a/src/main/java/com/sixteam/irs/mapper/EnterpriseMapper.java b/src/main/java/com/sixteam/irs/mapper/EnterpriseMapper.java index 1224d1e..3e8cad9 100644 --- a/src/main/java/com/sixteam/irs/mapper/EnterpriseMapper.java +++ b/src/main/java/com/sixteam/irs/mapper/EnterpriseMapper.java @@ -2,14 +2,24 @@ package com.sixteam.irs.mapper; import com.sixteam.irs.entity.Enterprise; import org.apache.ibatis.annotations.*; +import org.springframework.stereotype.Repository; import java.util.List; @Mapper +@Repository public interface EnterpriseMapper { - @Select("select * from irs_enterprise") - List<Enterprise> getAllEnterprise(); - @Insert("INSERT INTO irs_enterprise(e_id,e_name,e_introduce,e_start,e_type,e_founder)"+ - "VALUES('4','碧蓝航线','上海宽娱数码科技有限公司','2017年6月2日','战舰游戏','勇仕')") + + + List<Enterprise> findAllEnterprise(); + + Enterprise findById(Enterprise enterprise); + int addEnterprise(Enterprise enterprise); + + int delEnterprise(Enterprise enterprise); + + int updateEnterprise(Enterprise enterprise); + + List<Enterprise> findEnterpriseByName(Enterprise enterprise); } diff --git a/src/main/java/com/sixteam/irs/mapper/UserMapper.java b/src/main/java/com/sixteam/irs/mapper/UserMapper.java index 473c57b..9d4a58a 100644 --- a/src/main/java/com/sixteam/irs/mapper/UserMapper.java +++ b/src/main/java/com/sixteam/irs/mapper/UserMapper.java @@ -1,6 +1,7 @@ package com.sixteam.irs.mapper; -import com.sixteam.irs.model.User; + +import com.sixteam.irs.entity.User; import org.apache.ibatis.annotations.Mapper; import org.springframework.stereotype.Repository; diff --git a/src/main/java/com/sixteam/irs/mapper/UserRole.java b/src/main/java/com/sixteam/irs/mapper/UserRole.java deleted file mode 100644 index b2832ef..0000000 --- a/src/main/java/com/sixteam/irs/mapper/UserRole.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.sixteam.irs.mapper; - -import org.apache.ibatis.annotations.Mapper; -import org.springframework.stereotype.Repository; - -@Mapper -@Repository -public interface UserRole { -} diff --git a/src/main/java/com/sixteam/irs/model/Enterprise.java b/src/main/java/com/sixteam/irs/model/Enterprise.java deleted file mode 100644 index 9fe7275..0000000 --- a/src/main/java/com/sixteam/irs/model/Enterprise.java +++ /dev/null @@ -1,124 +0,0 @@ -package com.sixteam.irs.model; - -public class Enterprise { - - private String eId; - private String eName; - private String eIntroduce; - private String eStart; - private String eType; - private String eFounder; - - - public Enterprise() { - } - - public Enterprise(String eId, String eName, String eIntroduce, String eStart, String eType, String eFounder) { - this.eId = eId; - this.eName = eName; - this.eIntroduce = eIntroduce; - this.eStart = eStart; - this.eType = eType; - this.eFounder = eFounder; - } - - /** - * 获取 - * @return eId - */ - public String getEId() { - return eId; - } - - /** - * 设置 - * @param eId - */ - public void setEId(String eId) { - this.eId = eId; - } - - /** - * 获取 - * @return eName - */ - public String getEName() { - return eName; - } - - /** - * 设置 - * @param eName - */ - public void setEName(String eName) { - this.eName = eName; - } - - /** - * 获取 - * @return eIntroduce - */ - public String getEIntroduce() { - return eIntroduce; - } - - /** - * 设置 - * @param eIntroduce - */ - public void setEIntroduce(String eIntroduce) { - this.eIntroduce = eIntroduce; - } - - /** - * 获取 - * @return eStart - */ - public String getEStart() { - return eStart; - } - - /** - * 设置 - * @param eStart - */ - public void setEStart(String eStart) { - this.eStart = eStart; - } - - /** - * 获取 - * @return eType - */ - public String getEType() { - return eType; - } - - /** - * 设置 - * @param eType - */ - public void setEType(String eType) { - this.eType = eType; - } - - /** - * 获取 - * @return eFounder - */ - public String getEFounder() { - return eFounder; - } - - /** - * 设置 - * @param eFounder - */ - public void setEFounder(String eFounder) { - this.eFounder = eFounder; - } - - public String toString() { - return "Enterprise{eId = " + eId + ", eName = " + eName + ", eIntroduce = " + eIntroduce + ", eStart = " + eStart + ", eType = " + eType + ", eFounder = " + eFounder + "}"; - } -} diff --git a/src/main/java/com/sixteam/irs/model/User.java b/src/main/java/com/sixteam/irs/model/User.java deleted file mode 100644 index 771bd1a..0000000 --- a/src/main/java/com/sixteam/irs/model/User.java +++ /dev/null @@ -1,140 +0,0 @@ -package com.sixteam.irs.model; - -public class User { - private String uId; - private String uName; - private String uPassword; - private String uPhone; - private String uEmail; - private String uSex; - private String uBirthDate; - - public User() { - } - - public User(String uId, String uName, String uPassword, String uPhone, String uEmail, String uSex, String uBirthDate) { - this.uId = uId; - this.uName = uName; - this.uPassword = uPassword; - this.uPhone = uPhone; - this.uEmail = uEmail; - this.uSex = uSex; - this.uBirthDate = uBirthDate; - } - - /** - * 获取 - * @return uId - */ - public String getUId() { - return uId; - } - - /** - * 设置 - * @param uId - */ - public void setUId(String uId) { - this.uId = uId; - } - - /** - * 获取 - * @return uName - */ - public String getUName() { - return uName; - } - - /** - * 设置 - * @param uName - */ - public void setUName(String uName) { - this.uName = uName; - } - - /** - * 获取 - * @return uPassword - */ - public String getUPassword() { - return uPassword; - } - - /** - * 设置 - * @param uPassword - */ - public void setUPassword(String uPassword) { - this.uPassword = uPassword; - } - - /** - * 获取 - * @return uPhone - */ - public String getUPhone() { - return uPhone; - } - - /** - * 设置 - * @param uPhone - */ - public void setUPhone(String uPhone) { - this.uPhone = uPhone; - } - - /** - * 获取 - * @return uEmail - */ - public String getUEmail() { - return uEmail; - } - - /** - * 设置 - * @param uEmail - */ - public void setUEmail(String uEmail) { - this.uEmail = uEmail; - } - - /** - * 获取 - * @return uSex - */ - public String getUSex() { - return uSex; - } - - /** - * 设置 - * @param uSex - */ - public void setUSex(String uSex) { - this.uSex = uSex; - } - - /** - * 获取 - * @return uBirthDate - */ - public String getUBirthDate() { - return uBirthDate; - } - - /** - * 设置 - * @param uBirthDate - */ - public void setUBirthDate(String uBirthDate) { - this.uBirthDate = uBirthDate; - } - - public String toString() { - return "User{uId = " + uId + ", uName = " + uName + ", uPassword = " + uPassword + ", uPhone = " + uPhone + ", uEmail = " + uEmail + ", uSex = " + uSex + ", uBirthDate = " + uBirthDate + "}"; - } -} diff --git a/src/main/java/com/sixteam/irs/service/EnterpriseService.java b/src/main/java/com/sixteam/irs/service/EnterpriseService.java index d07aa15..e2f138b 100644 --- a/src/main/java/com/sixteam/irs/service/EnterpriseService.java +++ b/src/main/java/com/sixteam/irs/service/EnterpriseService.java @@ -10,4 +10,14 @@ public interface EnterpriseService { int addEnterprise(Enterprise enterprise);//添加企业 + + List<Enterprise> findAllEnterprise(); + + List<Enterprise> findEnterpriseByName(Enterprise enterprise); + + Enterprise findById(Enterprise enterprise); + + int delEnterprise(Enterprise enterprise); + + int updateEnterprise(Enterprise enterprise); } diff --git a/src/main/java/com/sixteam/irs/service/EnterpriseServiceImpl.java b/src/main/java/com/sixteam/irs/service/EnterpriseServiceImpl.java deleted file mode 100644 index 3080583..0000000 --- a/src/main/java/com/sixteam/irs/service/EnterpriseServiceImpl.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.sixteam.irs.service; - -import com.sixteam.irs.entity.Enterprise; -import com.sixteam.irs.mapper.EnterpriseMapper; -import com.sixteam.irs.service.EnterpriseService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.List; - -@Service -public class EnterpriseServiceImpl implements EnterpriseService { - @Autowired - private EnterpriseMapper enterpriseMapper; - - @Override - public List<Enterprise> getAllEnterprise() { - return enterpriseMapper.getAllEnterprise(); - } - - @Override - public int addEnterprise(Enterprise enterprise) { - return enterpriseMapper.addEnterprise(enterprise); - } -} diff --git a/src/main/java/com/sixteam/irs/service/EncyclopediaServiceImpl.java b/src/main/java/com/sixteam/irs/service/Impl/EncyclopediaServiceImpl.java similarity index 97% rename from src/main/java/com/sixteam/irs/service/EncyclopediaServiceImpl.java rename to src/main/java/com/sixteam/irs/service/Impl/EncyclopediaServiceImpl.java index f65cfb9..6c0cfff 100644 --- a/src/main/java/com/sixteam/irs/service/EncyclopediaServiceImpl.java +++ b/src/main/java/com/sixteam/irs/service/Impl/EncyclopediaServiceImpl.java @@ -1,4 +1,4 @@ -package com.sixteam.irs.service; +package com.sixteam.irs.service.Impl; import com.sixteam.irs.entity.Encyclopedia; diff --git a/src/main/java/com/sixteam/irs/service/EnterpriceServiceImpl.java b/src/main/java/com/sixteam/irs/service/Impl/EnterpriceServiceImpl.java similarity index 83% rename from src/main/java/com/sixteam/irs/service/EnterpriceServiceImpl.java rename to src/main/java/com/sixteam/irs/service/Impl/EnterpriceServiceImpl.java index 139d68e..d1b769e 100644 --- a/src/main/java/com/sixteam/irs/service/EnterpriceServiceImpl.java +++ b/src/main/java/com/sixteam/irs/service/Impl/EnterpriceServiceImpl.java @@ -1,7 +1,8 @@ -package com.sixteam.irs.service; +package com.sixteam.irs.service.Impl; +import com.sixteam.irs.entity.Enterprise; import com.sixteam.irs.mapper.EnterpriseMapper; -import com.sixteam.irs.model.Enterprise; + import com.sixteam.irs.service.EnterpriseService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -14,6 +15,11 @@ public class EnterpriceServiceImpl implements EnterpriseService { @Autowired private EnterpriseMapper enterpriseMapper; + @Override + public List<Enterprise> getAllEnterprise() { + return null; + } + @Override public List<Enterprise> findAllEnterprise() { return enterpriseMapper.findAllEnterprise(); @@ -25,7 +31,7 @@ public class EnterpriceServiceImpl implements EnterpriseService { } @Override - public Exception findById(Enterprise enterprise) { + public Enterprise findById(Enterprise enterprise) { return enterpriseMapper.findById(enterprise); } diff --git a/src/main/java/com/sixteam/irs/service/JurisdictionServiceImpl.java b/src/main/java/com/sixteam/irs/service/Impl/JurisdictionServiceImpl.java similarity index 95% rename from src/main/java/com/sixteam/irs/service/JurisdictionServiceImpl.java rename to src/main/java/com/sixteam/irs/service/Impl/JurisdictionServiceImpl.java index c5f153e..973473e 100644 --- a/src/main/java/com/sixteam/irs/service/JurisdictionServiceImpl.java +++ b/src/main/java/com/sixteam/irs/service/Impl/JurisdictionServiceImpl.java @@ -1,4 +1,4 @@ -package com.sixteam.irs.service; +package com.sixteam.irs.service.Impl; import com.sixteam.irs.entity.Jurisdiction; import com.sixteam.irs.mapper.JurisdictionMapper; diff --git a/src/main/java/com/sixteam/irs/service/ResumeServiceImpl.java b/src/main/java/com/sixteam/irs/service/Impl/ResumeServiceImpl.java similarity index 83% rename from src/main/java/com/sixteam/irs/service/ResumeServiceImpl.java rename to src/main/java/com/sixteam/irs/service/Impl/ResumeServiceImpl.java index ecdddcd..3bbfd83 100644 --- a/src/main/java/com/sixteam/irs/service/ResumeServiceImpl.java +++ b/src/main/java/com/sixteam/irs/service/Impl/ResumeServiceImpl.java @@ -1,7 +1,8 @@ -package com.sixteam.irs.service; +package com.sixteam.irs.service.Impl; import com.sixteam.irs.entity.Resume; import com.sixteam.irs.mapper.ResumeMapper; +import com.sixteam.irs.service.ResumeService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; diff --git a/src/main/java/com/sixteam/irs/service/StationResumeServiceImpl.java b/src/main/java/com/sixteam/irs/service/Impl/StationResumeServiceImpl.java similarity index 85% rename from src/main/java/com/sixteam/irs/service/StationResumeServiceImpl.java rename to src/main/java/com/sixteam/irs/service/Impl/StationResumeServiceImpl.java index 0449e64..bde2e99 100644 --- a/src/main/java/com/sixteam/irs/service/StationResumeServiceImpl.java +++ b/src/main/java/com/sixteam/irs/service/Impl/StationResumeServiceImpl.java @@ -1,7 +1,8 @@ -package com.sixteam.irs.service; +package com.sixteam.irs.service.Impl; import com.sixteam.irs.entity.StationResume; import com.sixteam.irs.mapper.StationResumeMapper; +import com.sixteam.irs.service.StationResumeService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; diff --git a/src/main/java/com/sixteam/irs/service/StationServiceImpl.java b/src/main/java/com/sixteam/irs/service/Impl/StationServiceImpl.java similarity index 95% rename from src/main/java/com/sixteam/irs/service/StationServiceImpl.java rename to src/main/java/com/sixteam/irs/service/Impl/StationServiceImpl.java index 9ff410e..1bd6a7b 100644 --- a/src/main/java/com/sixteam/irs/service/StationServiceImpl.java +++ b/src/main/java/com/sixteam/irs/service/Impl/StationServiceImpl.java @@ -1,4 +1,4 @@ -package com.sixteam.irs.service; +package com.sixteam.irs.service.Impl; import com.sixteam.irs.entity.Station; import com.sixteam.irs.mapper.StationMapper; diff --git a/src/main/java/com/sixteam/irs/service/UserServiceImpl.java b/src/main/java/com/sixteam/irs/service/Impl/UserServiceImpl.java similarity index 89% rename from src/main/java/com/sixteam/irs/service/UserServiceImpl.java rename to src/main/java/com/sixteam/irs/service/Impl/UserServiceImpl.java index 43b478d..8d9a359 100644 --- a/src/main/java/com/sixteam/irs/service/UserServiceImpl.java +++ b/src/main/java/com/sixteam/irs/service/Impl/UserServiceImpl.java @@ -1,7 +1,8 @@ -package com.sixteam.irs.service; +package com.sixteam.irs.service.Impl; +import com.sixteam.irs.entity.User; import com.sixteam.irs.mapper.UserMapper; -import com.sixteam.irs.model.User; + import com.sixteam.irs.service.UserService; import com.sixteam.irs.utils.UuidUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -32,7 +33,7 @@ public class UserServiceImpl implements UserService { @Override public int addUser(User user) { - user.setUId(UuidUtils.uuid()); + user.setuId(UuidUtils.uuid()); return userMapper.addUser(user); } diff --git a/src/main/java/com/sixteam/irs/service/UserService.java b/src/main/java/com/sixteam/irs/service/UserService.java index 1153de9..a538775 100644 --- a/src/main/java/com/sixteam/irs/service/UserService.java +++ b/src/main/java/com/sixteam/irs/service/UserService.java @@ -1,6 +1,8 @@ package com.sixteam.irs.service; -import com.sixteam.irs.model.User; + + +import com.sixteam.irs.entity.User; import java.util.List; diff --git a/src/main/shujuku b/src/main/java/com/sixteam/irs/sql/shujuku similarity index 100% rename from src/main/shujuku rename to src/main/java/com/sixteam/irs/sql/shujuku diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 62c3b0c..abe0d02 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -1,5 +1,5 @@ server: - port: 80 + port: 82 spring: datasource: driver-class-name: com.mysql.jdbc.Driver @@ -16,6 +16,6 @@ spring: mybatis: configuration: map-underscore-to-camel-case: true - #�����շ�ʽ + #�����շ�ʽ mapper-locations: classpath:mapper/*.xml type-aliases-package: com.sixteam.irs.entity diff --git a/src/main/resources/com/sixteam/irs/mapper/EnterpriseMapper.xml b/src/main/resources/com/sixteam/irs/mapper/EnterpriseMapper.xml index 3022fde..11cb26f 100644 --- a/src/main/resources/com/sixteam/irs/mapper/EnterpriseMapper.xml +++ b/src/main/resources/com/sixteam/irs/mapper/EnterpriseMapper.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > <mapper namespace="com.sixteam.irs.mapper.EnterpriseMapper"> - <resultMap id="eResult" type="com.sixteam.irs.model.Enterprise"> + <resultMap id="eResult" type="com.sixteam.irs.entity.Enterprise"> <id column="e_id" property="eId"/> <result column="e_name" property="eName"/> <result column="e_introduce" property="eIntroduce"/> diff --git a/src/main/resources/com/sixteam/irs/mapper/UserMapper.xml b/src/main/resources/com/sixteam/irs/mapper/UserMapper.xml index 2355f5b..7d10075 100644 --- a/src/main/resources/com/sixteam/irs/mapper/UserMapper.xml +++ b/src/main/resources/com/sixteam/irs/mapper/UserMapper.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > <mapper namespace="com.sixteam.irs.mapper.UserMapper"> - <resultMap id="userResult" type="com.sixteam.irs.model.User"> + <resultMap id="userResult" type="com.sixteam.irs.entity.User"> <id column="u_id" property="uId"/> <result column="u_name" property="uName"/> <result column="u_eamil" property="uEmail"/> diff --git a/src/main/resources/com/sixteam/irs/mapper/UserRole.xml b/src/main/resources/com/sixteam/irs/mapper/UserRole.xml deleted file mode 100644 index 7e3e026..0000000 --- a/src/main/resources/com/sixteam/irs/mapper/UserRole.xml +++ /dev/null @@ -1,9 +0,0 @@ -?xml version="1.0" encoding="UTF-8" ?> -<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > -<mapper namespace="com.sixteam.irs.mapper.UserRole"> - <resultMap id="UserRole" type="com.sixteam.irs.entity.UserRole"> - <id property="urId" column="ur_id"></id> - <result property="uId" column="u_id"></result> - <result property="rId" column="r_id"></result> - </resultMap> -</mapper> \ No newline at end of file diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html index 0587296..bfd132e 100644 --- a/src/main/resources/templates/index.html +++ b/src/main/resources/templates/index.html @@ -1,10 +1,10 @@ <!DOCTYPE html> -<html lang="en" xmlns:th="http://www.thymeleaf.org"> +<html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> - <a th:href="@{/user/findAllUser}">查询所有</a> +<h1>首页</h1> </body> </html> \ No newline at end of file -- Gitee From b3d4dc00d570ab48f8793f0dc81640e23a46d53d Mon Sep 17 00:00:00 2001 From: Wklizx <wklizxsama@qq.com> Date: Wed, 17 Aug 2022 08:24:01 +0800 Subject: [PATCH 2/3] =?UTF-8?q?8.17=E6=AD=A3=E5=BC=8F=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 6 ++++++ .../java/com/sixteam/irs/controller/UserController.java | 2 +- src/main/resources/application.yml | 2 +- src/main/resources/templates/{ => test}/index.html | 0 4 files changed, 8 insertions(+), 2 deletions(-) rename src/main/resources/templates/{ => test}/index.html (100%) diff --git a/pom.xml b/pom.xml index bb5afb7..796669b 100644 --- a/pom.xml +++ b/pom.xml @@ -89,6 +89,12 @@ <version>1.1.2</version> </dependency> + <!-- thymeleaf模板依赖 --> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-thymeleaf</artifactId> + </dependency> + </dependencies> <build> diff --git a/src/main/java/com/sixteam/irs/controller/UserController.java b/src/main/java/com/sixteam/irs/controller/UserController.java index 3e0fe88..d220e4c 100644 --- a/src/main/java/com/sixteam/irs/controller/UserController.java +++ b/src/main/java/com/sixteam/irs/controller/UserController.java @@ -25,7 +25,7 @@ public class UserController { @RequestMapping("") public String start(){ System.out.println("启动"); - return "/index.jsp"; + return "/test/index.html"; } @RequestMapping("/findAllUser") diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index abe0d02..bfbf38d 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -16,6 +16,6 @@ spring: mybatis: configuration: map-underscore-to-camel-case: true - #�����շ�ʽ + mapper-locations: classpath:mapper/*.xml type-aliases-package: com.sixteam.irs.entity diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/test/index.html similarity index 100% rename from src/main/resources/templates/index.html rename to src/main/resources/templates/test/index.html -- Gitee From 379d3d9e8205a4ff084df303d77dcda5327475d4 Mon Sep 17 00:00:00 2001 From: Wklizx <wklizxsama@qq.com> Date: Wed, 17 Aug 2022 11:11:58 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=86=99=E4=BA=86=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E7=9A=84=E7=AE=A1=E7=90=86=E6=A1=86=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/EncyclopediaController.java | 2 + .../irs/controller/UserController.java | 164 ++++++++++++------ ...\345\221\230\351\246\226\351\241\265.html" | 20 +++ src/main/resources/templates/test/index.html | 2 + ...\346\224\271\347\224\250\346\210\267.html" | 20 +++ ...\345\212\240\347\224\250\346\210\267.html" | 15 ++ ...\346\210\267\345\210\227\350\241\250.html" | 45 +++++ ...\346\210\267\351\246\226\351\241\265.html" | 10 ++ 8 files changed, 225 insertions(+), 53 deletions(-) create mode 100644 "src/main/resources/templates/test/admin/\347\256\241\347\220\206\345\221\230\351\246\226\351\241\265.html" create mode 100644 "src/main/resources/templates/test/user/\344\277\256\346\224\271\347\224\250\346\210\267.html" create mode 100644 "src/main/resources/templates/test/user/\345\242\236\345\212\240\347\224\250\346\210\267.html" create mode 100644 "src/main/resources/templates/test/user/\347\224\250\346\210\267\345\210\227\350\241\250.html" create mode 100644 "src/main/resources/templates/test/user/\347\224\250\346\210\267\351\246\226\351\241\265.html" diff --git a/src/main/java/com/sixteam/irs/controller/EncyclopediaController.java b/src/main/java/com/sixteam/irs/controller/EncyclopediaController.java index bddcbdc..f4603cf 100644 --- a/src/main/java/com/sixteam/irs/controller/EncyclopediaController.java +++ b/src/main/java/com/sixteam/irs/controller/EncyclopediaController.java @@ -21,6 +21,8 @@ public class EncyclopediaController { private EncyclopediaService encyclopediaService; + + @RequestMapping(value = "/list") public String list(ModelMap map, @RequestParam(defaultValue="1",required=true,value="pageNo") Integer pageNo) { diff --git a/src/main/java/com/sixteam/irs/controller/UserController.java b/src/main/java/com/sixteam/irs/controller/UserController.java index d220e4c..2c15bfa 100644 --- a/src/main/java/com/sixteam/irs/controller/UserController.java +++ b/src/main/java/com/sixteam/irs/controller/UserController.java @@ -3,8 +3,6 @@ package com.sixteam.irs.controller; import com.sixteam.irs.entity.User; import com.sixteam.irs.service.UserService; -import com.sun.org.apache.xpath.internal.operations.Mod; -import org.apache.ibatis.annotations.Insert; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; @@ -22,76 +20,136 @@ public class UserController { @Autowired private UserService userService; - @RequestMapping("") + @RequestMapping("/") public String start(){ System.out.println("启动"); return "/test/index.html"; } - @RequestMapping("/findAllUser") - public String findAllUser(Model model){ - List<User> userList = userService.findAllUser(); - System.out.println(userList); - model.addAttribute("userList",userList); - return "userList.html"; + //前往管理员主页 + @RequestMapping("/admin") + public String goToAdminIndex(){ + return "/test/admin/管理员首页.html"; } - - @RequestMapping("/findUserByName") - public String findUserByName(Model model,User user){ - List<User> userList = userService.findUserByName(user); - model.addAttribute("userList",userList); - return "redirect:/user/findAllUser"; + //前往管理员主页 + @RequestMapping("/user") + public String goToUser(){ + return "/test/user/用户首页.html"; } - - - @RequestMapping(value = "/addUser") - public String addUser(User user, Model model) { - if (userService.addUser(user)>0) { - - return "redirect:/user/findAllUser"; - } else { - - model.addAttribute("errorMessage", "注册错误"); - return "error"; - } + //前往用户管理列表页面 + @RequestMapping("/userList") + public String userList(){ + //这里需要查询所有用户,包括角色,包括权限,返回到用户管理列表页面 + return "/test/user/用户列表.html"; } + //用于ajax,暂时不用管 + @RequestMapping("/getUserList") + @ResponseBody + public String getUserList(){ + //ajax获取页面列表 + return null; + } - @RequestMapping(value = "/delUser") - public String delUser(User user, Model model) { - - if (userService.delUser(user)>0) { - - return "redirect:/user/findAllUser"; - } else { - - model.addAttribute("errorMessage", "删除错误"); - return "error"; - } + //删除用户功能 + @RequestMapping("/delUser") + public String delUser(){ + //获取前台传来的用户id,删除该用户 + //返回前端 + return "redirect:/userList"; } + @RequestMapping("/addUser") + public String addUser(){ + //获取前台传来的用户 + //将用户添加 + return "redirect:/userList"; + } + //用户修改功能前的查询单个用户回显网页 @RequestMapping("/toUpdateUser") - public String toUpdateUser(User user, Model model, Integer id) { - - User user1 = userService.findById(user); - model.addAttribute("user1", user1); - - return "updateUser"; + public String toUpdateUser(){ + //获取前台传来的用户id,查询此用户 + //将数据传到修改页面 + return "/test/user/修改用户.html"; + } + //用户修改功能 + @RequestMapping("/updateUser") + public String updateUser(){ + //获取前台数据 + //修改用户 + //返回列表页 + return "redirect:/userList"; } - @RequestMapping(value = "/updateUser") - public String updateUser(User user, Model model) { - if (userService.updateUser(user)>0) { - return "redirect:/user/findAllUser"; - } else { - model.addAttribute("errorMessage", "修改错误"); - return "error"; - } - } +// @RequestMapping("/findAllUser") +// public String findAllUser(Model model){ +// List<User> userList = userService.findAllUser(); +// System.out.println(userList); +// model.addAttribute("userList",userList); +// return "userList.html"; +// } +// +// +// @RequestMapping("/findUserByName") +// public String findUserByName(Model model,User user){ +// List<User> userList = userService.findUserByName(user); +// model.addAttribute("userList",userList); +// return "redirect:/user/findAllUser"; +// } +// +// +// +// @RequestMapping(value = "/addUser") +// public String addUser(User user, Model model) { +// if (userService.addUser(user)>0) { +// +// return "redirect:/user/findAllUser"; +// } else { +// +// model.addAttribute("errorMessage", "注册错误"); +// return "error"; +// } +// } +// +// +// @RequestMapping(value = "/delUser") +// public String delUser(User user, Model model) { +// +// if (userService.delUser(user)>0) { +// +// return "redirect:/user/findAllUser"; +// } else { +// +// model.addAttribute("errorMessage", "删除错误"); +// return "error"; +// } +// } +// +// +// @RequestMapping("/toUpdateUser") +// public String toUpdateUser(User user, Model model, Integer id) { +// +// User user1 = userService.findById(user); +// model.addAttribute("user1", user1); +// +// return "updateUser"; +// } +// +// @RequestMapping("/updateUser") +// public String updateUser(User user, Model model) { +// if (userService.updateUser(user)>0) { +// +// return "redirect:/user/findAllUser"; +// } else { +// +// model.addAttribute("errorMessage", "修改错误"); +// return "error"; +// } +// } } diff --git "a/src/main/resources/templates/test/admin/\347\256\241\347\220\206\345\221\230\351\246\226\351\241\265.html" "b/src/main/resources/templates/test/admin/\347\256\241\347\220\206\345\221\230\351\246\226\351\241\265.html" new file mode 100644 index 0000000..e91f827 --- /dev/null +++ "b/src/main/resources/templates/test/admin/\347\256\241\347\220\206\345\221\230\351\246\226\351\241\265.html" @@ -0,0 +1,20 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <title>管理员首页</title> +</head> +<body> + <h1>管理员首页</h1> + <h3>功能列表:</h3> +<ul> +<h3>权限管理系统模块</h3> + <li><a href="/userList">用户管理</a></li><h4>这里可以查看用户的基础信息,用户拥有的角色,以及角色拥有的权限,可以管理用户,以及增删用户的角色</h4> + <li><a href="/role/roleList">角色管理</a></li><h4>这里可以查看角色基础信息,以及角色拥有的权限,可以管理角色,以及开启禁用某角色的某权限</h4> + + +<h3>管理员业务模块</h3> + <li>企业管理</li> +</ul> +</body> +</html> \ No newline at end of file diff --git a/src/main/resources/templates/test/index.html b/src/main/resources/templates/test/index.html index bfd132e..0047d39 100644 --- a/src/main/resources/templates/test/index.html +++ b/src/main/resources/templates/test/index.html @@ -6,5 +6,7 @@ </head> <body> <h1>首页</h1> +<a href="/admin">去管理员页面</a> +<a href="/user">去用户页面</a> </body> </html> \ No newline at end of file diff --git "a/src/main/resources/templates/test/user/\344\277\256\346\224\271\347\224\250\346\210\267.html" "b/src/main/resources/templates/test/user/\344\277\256\346\224\271\347\224\250\346\210\267.html" new file mode 100644 index 0000000..9fffe3d --- /dev/null +++ "b/src/main/resources/templates/test/user/\344\277\256\346\224\271\347\224\250\346\210\267.html" @@ -0,0 +1,20 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <title>修改用户</title> +</head> +<body> +<h1>修改用户页面</h1> +<table> + <tr> + <td>用户id</td> + + <td>用户信息</td> + <p>value的属性为后端传来的</p> + <a href="/updateUser">提交</a> +<!-- 将数据传到后台进行修改--> + </tr> +</table> +</body> +</html> \ No newline at end of file diff --git "a/src/main/resources/templates/test/user/\345\242\236\345\212\240\347\224\250\346\210\267.html" "b/src/main/resources/templates/test/user/\345\242\236\345\212\240\347\224\250\346\210\267.html" new file mode 100644 index 0000000..c47d4d9 --- /dev/null +++ "b/src/main/resources/templates/test/user/\345\242\236\345\212\240\347\224\250\346\210\267.html" @@ -0,0 +1,15 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <title>增加用户</title> +</head> +<body> + <h1>增加用户</h1> +<div> + <h2>输入用户数据</h2> + <h2>选择用户的角色,暂时不用实现</h2> + <a href="/addUser">去添加用户</a> +</div> +</body> +</html> \ No newline at end of file diff --git "a/src/main/resources/templates/test/user/\347\224\250\346\210\267\345\210\227\350\241\250.html" "b/src/main/resources/templates/test/user/\347\224\250\346\210\267\345\210\227\350\241\250.html" new file mode 100644 index 0000000..cde030c --- /dev/null +++ "b/src/main/resources/templates/test/user/\347\224\250\346\210\267\345\210\227\350\241\250.html" @@ -0,0 +1,45 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <title>用户列表</title> +</head> +<body> + <h1>这里是用户权限管理的用户列表页</h1> + <h2>这里显示后台带来的用户列表</h2> +<table> + <thead> + <tr> + <th>序号</th> + <th>用户信息(多列)</th> + <th>操作</th> + </tr> + </thead> + <tbody> + <tr> + <td>序号</td> + <td>用户信息(多列)</td> + <td> + <a href="/delUser">删除用户</a><!--传递该列的用户id用于查询该用户--> + <a href="/toUpdateUser">修改用户</a><!--传递该列的用户id用于查询该用户--> + <a href="/role/userRoleList">添删用户的角色</a><!--传递该列的用户id用于查询该用户的所有角色--> + </td> + <ul> + <!--显示角色列表--> + <li>角色1</li> + <li>角色2</li> + </ul> + <!--显示用户权限列表--> + <h4>这里显示的优先级别为:强制禁用,强制启用,禁用,启用</h4> + <ul> + <li>权限1:状态:强制启用</li> + <li>权限2:状态:未启用</li> + </ul> + </tr> + + </tbody> +</table> + + +</body> +</html> \ No newline at end of file diff --git "a/src/main/resources/templates/test/user/\347\224\250\346\210\267\351\246\226\351\241\265.html" "b/src/main/resources/templates/test/user/\347\224\250\346\210\267\351\246\226\351\241\265.html" new file mode 100644 index 0000000..fc56c4c --- /dev/null +++ "b/src/main/resources/templates/test/user/\347\224\250\346\210\267\351\246\226\351\241\265.html" @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <title>用户首页</title> +</head> +<body> + <h1>用户首页</h1> +</body> +</html> \ No newline at end of file -- Gitee