已修改9个文件
已添加2个文件
144 ■■■■■ 文件已修改
emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/controller/Test.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/query/EmergencyTeamQuery.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/query/db/EmergencyTeamDBQuery.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/repository/EmergencyTeamInfoRepository.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
emergency/emergency-service/src/main/resource/config/mapper/emergency/EmergencyTeamInfoMapper.xml 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/accountController/LoginController.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/accountController/MenuController.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/accountController/UserController.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/config/exception/GlobalExceptionHandler.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/config/security/TokenAuthenticationFilter.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/config/security/WebSecurityConfig.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/controller/Test.java
@@ -1,6 +1,7 @@
package com.gkhy.safePlatform.emergency.controller;
import com.gkhy.safePlatform.account.rpc.apimodel.UserAccountService;
import com.gkhy.safePlatform.account.rpc.apimodel.AccountAuthService;
import com.gkhy.safePlatform.account.rpc.apimodel.AccountAuthService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -12,7 +13,7 @@
public class Test {
    @DubboReference(check = false)
    private UserAccountService userAccountService;
    private AccountAuthService accountAuthService;
//    @Autowired
//    private DemoService demoService;
emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/query/EmergencyTeamQuery.java
@@ -2,4 +2,31 @@
public class EmergencyTeamQuery {
    private String team_name ;
    private String team_level ;
    public String getTeam_name() {
        return team_name;
    }
    public void setTeam_name(String team_name) {
        this.team_name = team_name;
    }
    public String getTeam_level() {
        return team_level;
    }
    public void setTeam_level(String team_level) {
        this.team_level = team_level;
    }
    @Override
    public String toString() {
        return "EmergencyTeamDBQuery{" +
                "team_name='" + team_name + '\'' +
                ", team_level='" + team_level + '\'' +
                '}';
    }
}
emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/query/db/EmergencyTeamDBQuery.java
@@ -2,4 +2,31 @@
public class EmergencyTeamDBQuery {
    private String team_name ;
    private String team_level ;
    public String getTeam_name() {
        return team_name;
    }
    public void setTeam_name(String team_name) {
        this.team_name = team_name;
    }
    public String getTeam_level() {
        return team_level;
    }
    public void setTeam_level(String team_level) {
        this.team_level = team_level;
    }
    @Override
    public String toString() {
        return "EmergencyTeamDBQuery{" +
                "team_name='" + team_name + '\'' +
                ", team_level='" + team_level + '\'' +
                '}';
    }
}
emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/repository/EmergencyTeamInfoRepository.java
@@ -12,5 +12,7 @@
@Repository
public interface EmergencyTeamInfoRepository extends BaseMapper<EmergencyTeamInfo> {
    List<EmergencyTeamInfoPageDO> selectEmergencyTeamList(Page<EmergencyTeamInfoPageDO> page, @Param("query") EmergencyTeamDBQuery emergencyTeamDBQuery);
}
emergency/emergency-service/src/main/resource/config/mapper/emergency/EmergencyTeamInfoMapper.xml
对比新文件
@@ -0,0 +1,21 @@
<?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.gkhy.safePlatform.emergency.repository.EmergencyTeamInfoRepository">
    <resultMap type="com.gkhy.safePlatform.emergency.entity.EmergencyTeamInfoPageDO" id="pageResult">
        <id column="id" property="id" jdbcType="BIGINT"/>
        <result column="team_level" property="teamLevel" />
        <result column="team_name" property="teamName" />
        <result column="principal_phone" property="principalPhone" />
        <result column="team_desc" property="teamDesc" />
    </resultMap>
    <select id="selectEmergencyTeamList" resultMap="pageResult">
        select id,`team_level`,`team_name`,`principal_phone`,`team_desc` from emergency_team where del_flag = 0
        <if test="query.teamName != null  and query.teamName != ''"> and `team_name` like concat('%', #{query.teamName}, '%')</if>
        <if test="query.teamLevel != null  and query.teamLevel != ''"> and `team_level` = #{query.teamLevel}</if>
    </select>
</mapper>
safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/accountController/LoginController.java
@@ -1,7 +1,7 @@
package com.gkhy.safePlatform.accountController;
import com.alibaba.fastjson.JSONObject;
import com.gkhy.safePlatform.account.rpc.apimodel.UserAccountService;
import com.gkhy.safePlatform.account.rpc.apimodel.AccountAuthService;
import com.gkhy.safePlatform.account.rpc.apimodel.model.resp.MenuRPCRespDTO;
import com.gkhy.safePlatform.account.rpc.apimodel.model.resp.UserLoginRPCRespDTO;
import com.gkhy.safePlatform.commons.vo.ResultVO;
@@ -20,18 +20,18 @@
public class LoginController {
    @DubboReference(check = false)
    private UserAccountService userAccountService;
    private AccountAuthService accountAuthService;
    @RequestMapping("/login")
    public ResultVO<UserLoginRPCRespDTO> authLogin(@RequestBody JSONObject loginForm){
        String username = loginForm.getString("username");
        String password = loginForm.getString("password");
        return userAccountService.authLogin(username, password);
        return accountAuthService.authLogin(username, password);
    }
    @RequestMapping("/menu")
    public ResultVO<List<MenuRPCRespDTO>> getMenu(Principal principal, Long projectId){
        String userId = principal.getName();
        return userAccountService.getMenu(Long.valueOf(userId), projectId);
        return accountAuthService.getMenu(Long.valueOf(userId), projectId);
    }
}
safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/accountController/MenuController.java
@@ -1,6 +1,6 @@
package com.gkhy.safePlatform.accountController;
import com.gkhy.safePlatform.account.rpc.apimodel.UserAccountService;
import com.gkhy.safePlatform.account.rpc.apimodel.AccountMenuService;
import com.gkhy.safePlatform.account.rpc.apimodel.model.req.MenuAddRPCReqDTO;
import com.gkhy.safePlatform.account.rpc.apimodel.model.resp.MenuModRPCReqDTO;
import com.gkhy.safePlatform.commons.enums.ResultCodes;
@@ -18,7 +18,7 @@
public class MenuController {
    @DubboReference(check = false)
    private UserAccountService userAccountService;
    private AccountMenuService accountMenuService;
    /**
@@ -27,7 +27,7 @@
    @RequestMapping(value = "/add",method = RequestMethod.POST)
    public ResultVO<String> addMenu(Principal principal, @RequestBody MenuAddRPCReqDTO menuAddDto) {
        String userId = principal.getName();
        return userAccountService.addMenu(Long.valueOf(userId), menuAddDto);
        return accountMenuService.addMenu(Long.valueOf(userId), menuAddDto);
    }
@@ -37,7 +37,7 @@
    @RequestMapping(value = "/mod",method = RequestMethod.POST)
    public ResultVO<String> addMenu(Principal principal, @RequestBody MenuModRPCReqDTO menuModDto) {
        String userId = principal.getName();
        return userAccountService.modMenu(Long.valueOf(userId), menuModDto);
        return accountMenuService.modMenu(Long.valueOf(userId), menuModDto);
    }
}
safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/accountController/UserController.java
对比新文件
@@ -0,0 +1,26 @@
package com.gkhy.safePlatform.accountController;
import com.gkhy.safePlatform.account.rpc.apimodel.AccountMenuService;
import com.gkhy.safePlatform.account.rpc.apimodel.AccountUserService;
import com.gkhy.safePlatform.account.rpc.apimodel.model.req.query.AccountRPCQuery;
import com.gkhy.safePlatform.commons.query.PageQuery;
import org.apache.dubbo.config.annotation.DubboReference;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.security.Principal;
@RestController
@RequestMapping("/account")
public class UserController {
    @DubboReference(check = false)
    private AccountUserService accountUserService;
    @RequestMapping("/page/list")
    public Object getUserPage(Principal principal, PageQuery<AccountRPCQuery> rpcQueryPageQuery) {
        return accountUserService.getAccountPage(Long.valueOf(principal.getName()), rpcQueryPageQuery);
    }
}
safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/config/exception/GlobalExceptionHandler.java
@@ -9,6 +9,7 @@
import org.slf4j.LoggerFactory;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.core.AuthenticationException;
import org.springframework.web.HttpRequestMethodNotSupportedException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
@@ -67,6 +68,19 @@
    /**
     * @Description: 请求方法
     */
    @ResponseBody
    @ExceptionHandler(value = HttpRequestMethodNotSupportedException.class)
    public ResultVO DHandler(HttpRequestMethodNotSupportedException e) {
        ResultVO resultVO = new ResultVO();
        resultVO.setCode(ResultCodes.CLIENT_METHOD_NOT_MATCH.getCode());
        resultVO.setMsg(e.getMessage());
        return resultVO;
    }
    /**
     * 系统错误异常
     */
    @ResponseBody
safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/config/security/TokenAuthenticationFilter.java
@@ -2,7 +2,8 @@
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.gkhy.safePlatform.account.rpc.apimodel.UserAccountService;
import com.gkhy.safePlatform.account.rpc.apimodel.AccountAuthService;
import com.gkhy.safePlatform.account.rpc.apimodel.AccountAuthService;
import com.gkhy.safePlatform.commons.co.CacheAuthority;
import com.gkhy.safePlatform.commons.co.CacheUser;
import com.gkhy.safePlatform.commons.enums.RedisKeyEnum;
@@ -37,7 +38,7 @@
    @Autowired
    private TokenConfig tokenConfig;
    @DubboReference(check = false)
    private UserAccountService userAccountService;
    private AccountAuthService userAccountService;
safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/config/security/WebSecurityConfig.java
@@ -1,6 +1,5 @@
package com.gkhy.safePlatform.config.security;
import com.gkhy.safePlatform.account.rpc.apimodel.UserAccountService;
import com.gkhy.safePlatform.config.security.customzie.CustomizeAccessDeniedHandler;
import com.gkhy.safePlatform.config.security.customzie.CustomizeAuthenticationEntryPoint;
import org.apache.dubbo.config.annotation.DubboReference;