feat(login): 添加获取默认公司编码功能
- 在 ApiLoginController 中新增 getCompanyCode 接口
- 在 ApiMallMemberService 和实现类中添加 getCompanyCode 方法
- 配置 WebMvcConfigure 排除该接口的拦截
- 扩展 YHAiCompanyMapper 添加 selectDictLabel 查询方法
- 创建 YHAiCompanyMapper.xml 映射文件实现字典查询逻辑
1 files added
5 files modified
| | |
| | | registration.addPathPatterns("/api/**");
|
| | | // registration.excludePathPatterns("/api/login/**");
|
| | | registration.excludePathPatterns("/api/login/xcxLogin");
|
| | | registration.excludePathPatterns("/api/login/getCompanyCode");
|
| | | registration.excludePathPatterns("/api/common/**");
|
| | | registration.excludePathPatterns("/api/category/**");
|
| | | registration.excludePathPatterns("/api/goods/**");
|
| | |
| | | return memberService.xcxLogin(apiXcxLoginDto); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "获取默认公司编码", notes = "获取默认公司编码") |
| | | @GetMapping(value = "/getCompanyCode") |
| | | public FebsResponse getCompanyCode(){ |
| | | |
| | | return memberService.getCompanyCode(); |
| | | } |
| | | |
| | | /** |
| | | * 小程序手机号登录 |
| | | */ |
| | |
| | | FebsResponse addLabelMember(ApiMemberLabelAddDto dto); |
| | | |
| | | FebsResponse insureLabelMember(ApiMemberLabelInsureDto dto); |
| | | |
| | | FebsResponse getCompanyCode(); |
| | | } |
| | |
| | | return new FebsResponse().success().message("操作成功"); |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse getCompanyCode() { |
| | | |
| | | String companyCode = yhAiCompanyMapper.selectDictLabel("xcx_register_default","default"); |
| | | return new FebsResponse().success().data(companyCode); |
| | | } |
| | | |
| | | // public static void main(String[] args) { |
| | | // Long userld = 16425L; |
| | | // String shopAccount = "爱和美医疗"; |
| | |
| | | import cc.mrbird.febs.yinhe.entity.YHAiCompany; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | @Mapper |
| | | public interface YHAiCompanyMapper extends BaseMapper<YHAiCompany> { |
| | | |
| | | String selectDictLabel(@Param("dictType") String dictType, @Param("dictValue") String dictValue); |
| | | |
| | | } |
| New file |
| | |
| | | <?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="cc.mrbird.febs.yinhe.mapper.YHAiCompanyMapper"> |
| | | |
| | | <select id="selectDictLabel" resultType="String"> |
| | | select dict_label from sys_dict_data |
| | | where dict_type = #{dictType} and dict_value = #{dictValue} |
| | | </select> |
| | | |
| | | </mapper> |