فهرست منبع

dev代码上sit解决报错

ldz 3 هفته پیش
والد
کامیت
57b026421a

+ 101 - 102
alien-gateway/src/main/java/shop/alien/gateway/controller/LawyerUserLogInController.java

@@ -1,102 +1,101 @@
-package shop.alien.gateway.controller;
-
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiOperationSupport;
-import io.swagger.annotations.ApiSort;
-import lombok.RequiredArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.web.bind.annotation.*;
-import shop.alien.entity.result.R;
-import shop.alien.entity.store.LawyerUser;
-import shop.alien.entity.store.dto.LawyerUserDto;
-import shop.alien.entity.store.vo.LawyerUserVo;
-import shop.alien.gateway.mapper.LawyerUserMapper;
-import shop.alien.gateway.service.LawyerUserLogInService;
-
-import java.util.Objects;
-import java.util.Optional;
-
-/**
- * 门店用户 前端控制器
- *
- * @author ssk
- * @since 2024-12-11
- */
-@Slf4j
-@Api(tags = {"律师用户"})
-@ApiSort(8)
-@CrossOrigin
-@RestController
-@RequestMapping("/lawyer/user")
-@RequiredArgsConstructor
-public class LawyerUserLogInController {
-
-    private final LawyerUserLogInService lawyerUserService;
-    private final LawyerUserMapper lawyerUserMapper;
-
-    @ApiOperation("律师用户注册")
-    @ApiOperationSupport(order = 1)
-    @PostMapping("/register")
-    public R<LawyerUserVo> register(@RequestBody LawyerUserDto lawyerUserDto) {
-        log.info("LawyerUserLogInController.login?lawyerUserDto={}", lawyerUserDto);
-        return lawyerUserService.logIn(lawyerUserDto);
-    }
-
-    @ApiOperation("律师用户验证码校验")
-    @ApiOperationSupport(order = 2)
-    @PostMapping("/checkMsgCode")
-    public R checkMsgCode(@RequestBody LawyerUserDto lawyerUserDto) {
-        log.info("LawyerUserLogInController.checkMsgCode?lawyerUserDto={}", lawyerUserDto);
-        return lawyerUserService.checkMsgCode(lawyerUserDto);
-    }
-
-    @ApiOperation("律师用户登录")
-    @ApiOperationSupport(order = 3)
-    @GetMapping("/login")
-    public R<LawyerUserVo> login(@RequestBody LawyerUserDto lawyerUserDto) {
-        log.info("LawyerUserLogInController.login?lawyerUserDto={}", lawyerUserDto);
-        LawyerUser lawyerUser = lawyerUserMapper.selectOne(new LambdaQueryWrapper<LawyerUser>()
-                .eq(LawyerUser::getPhone, lawyerUserDto.getPhone()));
-        if (null == lawyerUser) {
-            return R.fail("当前账号不存在,请先去注册账号!");
-        }
-        if (lawyerUser.getStatus() == 0) {
-            return R.fail("账号被禁用");
-        }
-        return Optional.ofNullable(lawyerUser).
-                map(user -> lawyerUserDto.getIsPassword() ? checkPassword(user, lawyerUserDto.getPassword()) : lawyerUserService.createToKen(user)).
-                orElseGet(() -> R.fail("手机号不存在"));
-    }
-
-    @ApiOperation("律师用户修改密码")
-    @ApiOperationSupport(order = 4)
-    @PostMapping("/updatePassWord")
-    public R updatePassWord(@RequestBody LawyerUserDto lawyerUserDto) {
-        log.info("LawyerUserLogInController.updatePassWord?lawyerUserDto={}", lawyerUserDto);
-        try {
-            LawyerUser lawyerUser = lawyerUserMapper.selectOne(new LambdaQueryWrapper<LawyerUser>()
-                    .eq(LawyerUser::getPhone, lawyerUserDto.getPhone()));
-            if (null == lawyerUser) {
-                return R.fail("当前账号不存在,请先去注册账号!");
-            }
-            if (lawyerUser.getStatus() == 0) {
-                return R.fail("账号被禁用");
-            }
-            LawyerUser update = new LawyerUser();
-            update.setPassword(lawyerUserDto.getPassword());
-            update.setId(lawyerUser.getId());
-            lawyerUserMapper.updateById(update);
-            return R.success("修改成功");
-        }catch (Exception e){
-            return R.fail("修改密码失败");
-        }
-    }
-
-    private R<LawyerUserVo> checkPassword(LawyerUser lawyerUser, String password) {
-        return Objects.equals(password, lawyerUser.getPassword())
-                ? lawyerUserService.createToKen(lawyerUser)
-                : R.fail("密码错误");
-    }
-}
+//package shop.alien.gateway.controller;
+//
+//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+//import io.swagger.annotations.Api;
+//import io.swagger.annotations.ApiOperation;
+//import io.swagger.annotations.ApiOperationSupport;
+//import io.swagger.annotations.ApiSort;
+//import lombok.RequiredArgsConstructor;
+//import lombok.extern.slf4j.Slf4j;
+//import org.springframework.web.bind.annotation.*;
+//import shop.alien.entity.result.R;
+//import shop.alien.entity.store.LawyerUser;
+//import shop.alien.entity.store.dto.LawyerUserDto;
+//import shop.alien.entity.store.vo.LawyerUserVo;
+//import shop.alien.gateway.mapper.LawyerUserMapper;
+//
+//import java.util.Objects;
+//import java.util.Optional;
+//
+///**
+// * 门店用户 前端控制器
+// *
+// * @author ssk
+// * @since 2024-12-11
+// */
+//@Slf4j
+//@Api(tags = {"律师用户"})
+//@ApiSort(8)
+//@CrossOrigin
+//@RestController
+//@RequestMapping("/lawyer/user")
+//@RequiredArgsConstructor
+//public class LawyerUserLogInController {
+//
+//    private final LawyerUserLogInService lawyerUserService;
+//    private final LawyerUserMapper lawyerUserMapper;
+//
+//    @ApiOperation("律师用户注册")
+//    @ApiOperationSupport(order = 1)
+//    @PostMapping("/register")
+//    public R<LawyerUserVo> register(@RequestBody LawyerUserDto lawyerUserDto) {
+//        log.info("LawyerUserLogInController.login?lawyerUserDto={}", lawyerUserDto);
+//        return lawyerUserService.logIn(lawyerUserDto);
+//    }
+//
+//    @ApiOperation("律师用户验证码校验")
+//    @ApiOperationSupport(order = 2)
+//    @PostMapping("/checkMsgCode")
+//    public R checkMsgCode(@RequestBody LawyerUserDto lawyerUserDto) {
+//        log.info("LawyerUserLogInController.checkMsgCode?lawyerUserDto={}", lawyerUserDto);
+//        return lawyerUserService.checkMsgCode(lawyerUserDto);
+//    }
+//
+//    @ApiOperation("律师用户登录")
+//    @ApiOperationSupport(order = 3)
+//    @GetMapping("/login")
+//    public R<LawyerUserVo> login(@RequestBody LawyerUserDto lawyerUserDto) {
+//        log.info("LawyerUserLogInController.login?lawyerUserDto={}", lawyerUserDto);
+//        LawyerUser lawyerUser = lawyerUserMapper.selectOne(new LambdaQueryWrapper<LawyerUser>()
+//                .eq(LawyerUser::getPhone, lawyerUserDto.getPhone()));
+//        if (null == lawyerUser) {
+//            return R.fail("当前账号不存在,请先去注册账号!");
+//        }
+//        if (lawyerUser.getStatus() == 0) {
+//            return R.fail("账号被禁用");
+//        }
+//        return Optional.ofNullable(lawyerUser).
+//                map(user -> lawyerUserDto.getIsPassword() ? checkPassword(user, lawyerUserDto.getPassword()) : lawyerUserService.createToKen(user)).
+//                orElseGet(() -> R.fail("手机号不存在"));
+//    }
+//
+//    @ApiOperation("律师用户修改密码")
+//    @ApiOperationSupport(order = 4)
+//    @PostMapping("/updatePassWord")
+//    public R updatePassWord(@RequestBody LawyerUserDto lawyerUserDto) {
+//        log.info("LawyerUserLogInController.updatePassWord?lawyerUserDto={}", lawyerUserDto);
+//        try {
+//            LawyerUser lawyerUser = lawyerUserMapper.selectOne(new LambdaQueryWrapper<LawyerUser>()
+//                    .eq(LawyerUser::getPhone, lawyerUserDto.getPhone()));
+//            if (null == lawyerUser) {
+//                return R.fail("当前账号不存在,请先去注册账号!");
+//            }
+//            if (lawyerUser.getStatus() == 0) {
+//                return R.fail("账号被禁用");
+//            }
+//            LawyerUser update = new LawyerUser();
+//            update.setPassword(lawyerUserDto.getPassword());
+//            update.setId(lawyerUser.getId());
+//            lawyerUserMapper.updateById(update);
+//            return R.success("修改成功");
+//        }catch (Exception e){
+//            return R.fail("修改密码失败");
+//        }
+//    }
+//
+//    private R<LawyerUserVo> checkPassword(LawyerUser lawyerUser, String password) {
+//        return Objects.equals(password, lawyerUser.getPassword())
+//                ? lawyerUserService.createToKen(lawyerUser)
+//                : R.fail("密码错误");
+//    }
+//}

+ 0 - 19
alien-gateway/src/main/java/shop/alien/gateway/mapper/LawFirmMapper.java

@@ -1,19 +0,0 @@
-package shop.alien.gateway.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.apache.ibatis.annotations.Mapper;
-import shop.alien.entity.store.LawFirm;
-
-/**
- * <p>
- * 律所表 Mapper 接口
- * </p>
- *
- * @author system
- * @since 2025-01-XX
- */
-@Mapper
-public interface LawFirmMapper extends BaseMapper<LawFirm> {
-
-}
-

+ 30 - 30
alien-gateway/src/main/java/shop/alien/gateway/mapper/LawyerServiceAreaMapper.java

@@ -1,30 +1,30 @@
-package shop.alien.gateway.mapper;
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.baomidou.mybatisplus.core.toolkit.Constants;
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-import org.apache.ibatis.annotations.Select;
-import shop.alien.entity.store.LawyerServiceArea;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * <p>
- * 律师服务领域关联 Mapper 接口
- * </p>
- *
- * @author system
- * @since 2025-01-XX
- */
-@Mapper
-public interface LawyerServiceAreaMapper extends BaseMapper<LawyerServiceArea> {
-
-    @Select("select lsa.lawyer_user_id, llps.name from lawyer_service_area lsa \n" +
-            "left join lawyer_legal_problem_scenario llps on llps.id = lsa.problem_scenario_id \n" +
-            " ${ew.customSqlSegment}")
-    List<Map<String, Object>> getLawyerLegalProblemScenarioList(@Param(Constants.WRAPPER) QueryWrapper<LawyerServiceArea> queryWrapper);
-}
-
+//package shop.alien.gateway.mapper;
+//
+//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+//import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+//import com.baomidou.mybatisplus.core.toolkit.Constants;
+//import org.apache.ibatis.annotations.Mapper;
+//import org.apache.ibatis.annotations.Param;
+//import org.apache.ibatis.annotations.Select;
+//import shop.alien.entity.store.LawyerServiceArea;
+//
+//import java.util.List;
+//import java.util.Map;
+//
+///**
+// * <p>
+// * 律师服务领域关联 Mapper 接口
+// * </p>
+// *
+// * @author system
+// * @since 2025-01-XX
+// */
+//@Mapper
+//public interface LawyerServiceAreaMapper extends BaseMapper<LawyerServiceArea> {
+//
+//    @Select("select lsa.lawyer_user_id, llps.name from lawyer_service_area lsa \n" +
+//            "left join lawyer_legal_problem_scenario llps on llps.id = lsa.problem_scenario_id \n" +
+//            " ${ew.customSqlSegment}")
+//    List<Map<String, Object>> getLawyerLegalProblemScenarioList(@Param(Constants.WRAPPER) QueryWrapper<LawyerServiceArea> queryWrapper);
+//}
+//

+ 89 - 89
alien-gateway/src/main/java/shop/alien/gateway/mapper/LawyerUserMapper.java

@@ -1,89 +1,89 @@
-package shop.alien.gateway.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Update;
-import shop.alien.entity.store.LawyerUser;
-
-/**
- * <p>
- * 律师用户 Mapper 接口
- * </p>
- *
- * @author system
- * @since 2025-01-XX
- */
-@Mapper
-public interface LawyerUserMapper extends BaseMapper<LawyerUser> {
-
-
-@Update("<script>" +
-        "UPDATE lawyer_user " +
-        "<set>" +
-        "<if test='firmId != null'>firm_id = #{firmId},</if>" +
-        "<if test='phone != null'>phone = #{phone},</if>" +
-        "<if test='name != null'>name = #{name},</if>" +
-        "<if test='idCard != null'>id_card = #{idCard},</if>" +
-        "<if test='password != null'>password = #{password},</if>" +
-        "<if test='payPassword != null'>pay_password = #{payPassword},</if>" +
-        "<if test='money != null'>money = #{money},</if>" +
-        "<if test='status != null'>status = #{status},</if>" +
-        "<if test='passType != null'>pass_type = #{passType},</if>" +
-        "<if test='deleteFlag != null'>delete_flag = #{deleteFlag},</if>" +
-        "<if test='createdTime != null'>created_time = #{createdTime},</if>" +
-        "<if test='createdUserId != null'>created_user_id = #{createdUserId},</if>" +
-        "<if test='updatedTime != null'>updated_time = #{updatedTime},</if>" +
-        "<if test='updatedUserId != null'>updated_user_id = #{updatedUserId},</if>" +
-        "<if test='logoutFlag != null'>logout_flag = #{logoutFlag},</if>" +
-        "<if test='logoutReason != null'>logout_reason = #{logoutReason},</if>" +
-        "<if test='logoutTime != null'>logout_time = #{logoutTime},</if>" +
-        "<if test='logoutCode != null'>logout_code = #{logoutCode},</if>" +
-        "<if test='nickName != null'>nick_name = #{nickName},</if>" +
-        "<if test='accountBlurb != null'>account_blurb = #{accountBlurb},</if>" +
-        "<if test='headImg != null'>head_img = #{headImg},</if>" +
-        "<if test='alipayAccount != null'>alipay_account = #{alipayAccount},</if>" +
-        "<if test='lawyerCertificateNo != null'>lawyer_certificate_no = #{lawyerCertificateNo},</if>" +
-        "<if test='lawFirm != null'>law_firm = #{lawFirm},</if>" +
-        "<if test='practiceYears != null'>practice_years = #{practiceYears},</if>" +
-        "<if test='practiceStartDate != null'>practice_start_date = #{practiceStartDate},</if>" +
-        "<if test='specialtyFields != null'>specialty_fields = #{specialtyFields},</if>" +
-        "<if test='certificationStatus != null'>certification_status = #{certificationStatus},</if>" +
-        "<if test='certificationFailReason != null'>certification_fail_reason = #{certificationFailReason},</if>" +
-        "<if test='certificationTime != null'>certification_time = #{certificationTime},</if>" +
-        "<if test='certificationReviewerId != null'>certification_reviewer_id = #{certificationReviewerId},</if>" +
-        "<if test='certificateImage != null'>certificate_image = #{certificateImage},</if>" +
-        "<if test='idCardFrontImage != null'>id_card_front_image = #{idCardFrontImage},</if>" +
-        "<if test='idCardBackImage != null'>id_card_back_image = #{idCardBackImage},</if>" +
-        "<if test='serviceScore != null'>service_score = #{serviceScore},</if>" +
-        "<if test='serviceCount != null'>service_count = #{serviceCount},</if>" +
-        "<if test='goodReviewCount != null'>good_review_count = #{goodReviewCount},</if>" +
-        "<if test='mediumReviewCount != null'>medium_review_count = #{mediumReviewCount},</if>" +
-        "<if test='badReviewCount != null'>bad_review_count = #{badReviewCount},</if>" +
-        "<if test='consultationFee != null'>consultation_fee = #{consultationFee},</if>" +
-        "<if test='agencyFee != null'>agency_fee = #{agencyFee},</if>" +
-        "<if test='province != null'>province = #{province},</if>" +
-        "<if test='city != null'>city = #{city},</if>" +
-        "<if test='district != null'>district = #{district},</if>" +
-        "<if test='address != null'>address = #{address},</if>" +
-        "<if test='email != null'>email = #{email},</if>" +
-        "<if test='gender != null'>gender = #{gender},</if>" +
-        "<if test='birthday != null'>birthday = #{birthday},</if>" +
-        "<if test='personalIntroduction != null'>personal_introduction = #{personalIntroduction},</if>" +
-        "<if test='educationBackground != null'>education_background = #{educationBackground},</if>" +
-        "<if test='workExperience != null'>work_experience = #{workExperience},</if>" +
-        "<if test='expertiseCases != null'>expertise_cases = #{expertiseCases},</if>" +
-        "<if test='isOnline != null'>is_online = #{isOnline},</if>" +
-        "<if test='lastOnlineTime != null'>last_online_time = #{lastOnlineTime},</if>" +
-        "<if test='isRecommended != null'>is_recommended = #{isRecommended},</if>" +
-        "<if test='recommendSort != null'>recommend_sort = #{recommendSort},</if>" +
-        "<if test='orderReceivingStatus != null'>order_receiving_status = #{orderReceivingStatus},</if>" +
-        "<if test='lawyerExpertiseAreaId != null'>lawyer_expertise_area_id = #{lawyerExpertiseAreaId},</if>" +
-        "<if test='commissionRate != null'>commission_rate = #{commissionRate},</if>" +
-        "<if test='paymentNum != null'>payment_num = #{paymentNum},</if>" +
-        "</set>" +
-        "WHERE id = #{id}" +
-        "</script>")
-Integer updateLawyerUser(LawyerUser user);
-
-}
-
+//package shop.alien.gateway.mapper;
+//
+//import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+//import org.apache.ibatis.annotations.Mapper;
+//import org.apache.ibatis.annotations.Update;
+//import shop.alien.entity.store.LawyerUser;
+//
+///**
+// * <p>
+// * 律师用户 Mapper 接口
+// * </p>
+// *
+// * @author system
+// * @since 2025-01-XX
+// */
+//@Mapper
+//public interface LawyerUserMapper extends BaseMapper<LawyerUser> {
+//
+//
+//@Update("<script>" +
+//        "UPDATE lawyer_user " +
+//        "<set>" +
+//        "<if test='firmId != null'>firm_id = #{firmId},</if>" +
+//        "<if test='phone != null'>phone = #{phone},</if>" +
+//        "<if test='name != null'>name = #{name},</if>" +
+//        "<if test='idCard != null'>id_card = #{idCard},</if>" +
+//        "<if test='password != null'>password = #{password},</if>" +
+//        "<if test='payPassword != null'>pay_password = #{payPassword},</if>" +
+//        "<if test='money != null'>money = #{money},</if>" +
+//        "<if test='status != null'>status = #{status},</if>" +
+//        "<if test='passType != null'>pass_type = #{passType},</if>" +
+//        "<if test='deleteFlag != null'>delete_flag = #{deleteFlag},</if>" +
+//        "<if test='createdTime != null'>created_time = #{createdTime},</if>" +
+//        "<if test='createdUserId != null'>created_user_id = #{createdUserId},</if>" +
+//        "<if test='updatedTime != null'>updated_time = #{updatedTime},</if>" +
+//        "<if test='updatedUserId != null'>updated_user_id = #{updatedUserId},</if>" +
+//        "<if test='logoutFlag != null'>logout_flag = #{logoutFlag},</if>" +
+//        "<if test='logoutReason != null'>logout_reason = #{logoutReason},</if>" +
+//        "<if test='logoutTime != null'>logout_time = #{logoutTime},</if>" +
+//        "<if test='logoutCode != null'>logout_code = #{logoutCode},</if>" +
+//        "<if test='nickName != null'>nick_name = #{nickName},</if>" +
+//        "<if test='accountBlurb != null'>account_blurb = #{accountBlurb},</if>" +
+//        "<if test='headImg != null'>head_img = #{headImg},</if>" +
+//        "<if test='alipayAccount != null'>alipay_account = #{alipayAccount},</if>" +
+//        "<if test='lawyerCertificateNo != null'>lawyer_certificate_no = #{lawyerCertificateNo},</if>" +
+//        "<if test='lawFirm != null'>law_firm = #{lawFirm},</if>" +
+//        "<if test='practiceYears != null'>practice_years = #{practiceYears},</if>" +
+//        "<if test='practiceStartDate != null'>practice_start_date = #{practiceStartDate},</if>" +
+//        "<if test='specialtyFields != null'>specialty_fields = #{specialtyFields},</if>" +
+//        "<if test='certificationStatus != null'>certification_status = #{certificationStatus},</if>" +
+//        "<if test='certificationFailReason != null'>certification_fail_reason = #{certificationFailReason},</if>" +
+//        "<if test='certificationTime != null'>certification_time = #{certificationTime},</if>" +
+//        "<if test='certificationReviewerId != null'>certification_reviewer_id = #{certificationReviewerId},</if>" +
+//        "<if test='certificateImage != null'>certificate_image = #{certificateImage},</if>" +
+//        "<if test='idCardFrontImage != null'>id_card_front_image = #{idCardFrontImage},</if>" +
+//        "<if test='idCardBackImage != null'>id_card_back_image = #{idCardBackImage},</if>" +
+//        "<if test='serviceScore != null'>service_score = #{serviceScore},</if>" +
+//        "<if test='serviceCount != null'>service_count = #{serviceCount},</if>" +
+//        "<if test='goodReviewCount != null'>good_review_count = #{goodReviewCount},</if>" +
+//        "<if test='mediumReviewCount != null'>medium_review_count = #{mediumReviewCount},</if>" +
+//        "<if test='badReviewCount != null'>bad_review_count = #{badReviewCount},</if>" +
+//        "<if test='consultationFee != null'>consultation_fee = #{consultationFee},</if>" +
+//        "<if test='agencyFee != null'>agency_fee = #{agencyFee},</if>" +
+//        "<if test='province != null'>province = #{province},</if>" +
+//        "<if test='city != null'>city = #{city},</if>" +
+//        "<if test='district != null'>district = #{district},</if>" +
+//        "<if test='address != null'>address = #{address},</if>" +
+//        "<if test='email != null'>email = #{email},</if>" +
+//        "<if test='gender != null'>gender = #{gender},</if>" +
+//        "<if test='birthday != null'>birthday = #{birthday},</if>" +
+//        "<if test='personalIntroduction != null'>personal_introduction = #{personalIntroduction},</if>" +
+//        "<if test='educationBackground != null'>education_background = #{educationBackground},</if>" +
+//        "<if test='workExperience != null'>work_experience = #{workExperience},</if>" +
+//        "<if test='expertiseCases != null'>expertise_cases = #{expertiseCases},</if>" +
+//        "<if test='isOnline != null'>is_online = #{isOnline},</if>" +
+//        "<if test='lastOnlineTime != null'>last_online_time = #{lastOnlineTime},</if>" +
+//        "<if test='isRecommended != null'>is_recommended = #{isRecommended},</if>" +
+//        "<if test='recommendSort != null'>recommend_sort = #{recommendSort},</if>" +
+//        "<if test='orderReceivingStatus != null'>order_receiving_status = #{orderReceivingStatus},</if>" +
+//        "<if test='lawyerExpertiseAreaId != null'>lawyer_expertise_area_id = #{lawyerExpertiseAreaId},</if>" +
+//        "<if test='commissionRate != null'>commission_rate = #{commissionRate},</if>" +
+//        "<if test='paymentNum != null'>payment_num = #{paymentNum},</if>" +
+//        "</set>" +
+//        "WHERE id = #{id}" +
+//        "</script>")
+//Integer updateLawyerUser(LawyerUser user);
+//
+//}
+//

+ 0 - 27
alien-gateway/src/main/java/shop/alien/gateway/service/LawyerUserLogInService.java

@@ -1,27 +0,0 @@
-package shop.alien.gateway.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import shop.alien.entity.result.R;
-import shop.alien.entity.store.LawyerUser;
-import shop.alien.entity.store.StoreUser;
-import shop.alien.entity.store.dto.LawyerUserDto;
-import shop.alien.entity.store.vo.LawyerUserVo;
-import shop.alien.entity.store.vo.StoreUserVo;
-
-/**
- * 二期-门店用户 服务类
- *
- * @author ssk
- * @since 2024-12-11
- */
-public interface LawyerUserLogInService extends IService<LawyerUser> {
-
-    /**
-     * 创建token
-     * @return
-     */
-    R<LawyerUserVo> createToKen(LawyerUser lawyerUser);
-    R<LawyerUserVo> logIn(LawyerUserDto lawyerUserDto);
-    R checkMsgCode(LawyerUserDto lawyerUserDto);
-
-}

+ 150 - 152
alien-gateway/src/main/java/shop/alien/gateway/service/impl/LawyerUserLogInServiceImpl.java

@@ -1,152 +1,150 @@
-package shop.alien.gateway.service.impl;
-
-import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
-import com.baomidou.mybatisplus.core.toolkit.StringUtils;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import lombok.RequiredArgsConstructor;
-import org.springframework.beans.BeanUtils;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-import shop.alien.entity.result.R;
-import shop.alien.entity.store.LawFirm;
-import shop.alien.entity.store.LawyerServiceArea;
-import shop.alien.entity.store.LawyerUser;
-import shop.alien.entity.store.dto.LawyerUserDto;
-import shop.alien.entity.store.vo.LawyerUserVo;
-import shop.alien.gateway.config.BaseRedisService;
-import shop.alien.gateway.mapper.LawFirmMapper;
-import shop.alien.gateway.mapper.LawyerServiceAreaMapper;
-import shop.alien.gateway.mapper.LawyerUserMapper;
-import shop.alien.gateway.service.LawyerUserLogInService;
-import shop.alien.util.common.JwtUtil;
-
-import java.util.*;
-import java.util.stream.Collectors;
-
-/**
- * 二期-门店用户 服务实现类
- *
- * @author ssk
- * @since 2024-12-11
- */
-@Transactional
-@Service
-@RequiredArgsConstructor
-public class LawyerUserLogInServiceImpl extends ServiceImpl<LawyerUserMapper, LawyerUser> implements LawyerUserLogInService {
-
-    @Value("${jwt.expiration-time}")
-    private String effectiveTime;
-
-    /**
-     * 设定初始化默认密码
-     */
-
-    private final BaseRedisService baseRedisService;
-    private final LawyerUserMapper lawyerUserMapper;
-    private final LawyerServiceAreaMapper lawyerServiceAreaMapper;
-    private final LawFirmMapper lawFirmMapper;
-
-    /**
-     * token
-     *
-     * @param lawyerUser
-     * @return
-     */
-    @Override
-    public R<LawyerUserVo> createToKen(LawyerUser lawyerUser) {
-        int effectiveTimeInt = Integer.parseInt(effectiveTime.substring(0, effectiveTime.length() - 1));
-        String effectiveTimeUnit = effectiveTime.substring(effectiveTime.length() - 1);
-        long effectiveTimeIntLong = 0L;
-        switch (effectiveTimeUnit) {
-            case "s": {
-                effectiveTimeIntLong = effectiveTimeInt * 1000L;
-                break;
-            }
-            case "m": {
-                effectiveTimeIntLong = effectiveTimeInt * 60L * 1000L;
-                break;
-            }
-            case "h": {
-                effectiveTimeIntLong = effectiveTimeInt * 60L * 60L * 1000L;
-                break;
-            }
-            case "d": {
-                effectiveTimeIntLong = effectiveTimeInt * 24L * 60L * 60L * 1000L;
-                break;
-            }
-        }
-
-        LawyerUserVo lawyerUserVo = new LawyerUserVo();
-        BeanUtils.copyProperties(lawyerUser, lawyerUserVo);
-        Map<String, String> tokenMap = new HashMap<>();
-        tokenMap.put("phone", lawyerUser.getPhone());
-        tokenMap.put("userName", lawyerUser.getName());
-        tokenMap.put("userId", lawyerUser.getId().toString());
-        tokenMap.put("userType", "lawyer");
-        tokenMap.put("passType", lawyerUser.getPassType().toString());
-        lawyerUserVo.setToken(JwtUtil.createJWT("lawyer_" + lawyerUser.getPhone(), lawyerUser.getName(), JSONObject.toJSONString(tokenMap), effectiveTimeIntLong));
-        baseRedisService.setString("lawyer_" + lawyerUser.getPhone(), lawyerUserVo.getToken());
-        return R.data(lawyerUserVo);
-    }
-
-    @Override
-    public R<LawyerUserVo> logIn(LawyerUserDto lawyerUserDto) {
-        LawyerUser lawyerUser = lawyerUserMapper.selectOne(new LambdaQueryWrapper<LawyerUser>()
-                .eq(LawyerUser::getPhone, lawyerUserDto.getPhone()).last("limit 1"));
-        if (ObjectUtils.isNotEmpty(lawyerUser)) {
-            if (lawyerUser.getStatus() == 0) {
-                return R.fail("账号被禁用");
-            }
-            lawyerUser.setPassType(1);
-            return createToKen(lawyerUser);
-        }else {
-            LawyerUser user = new LawyerUser();
-            BeanUtils.copyProperties(lawyerUserDto, user);
-            user.setLogoutFlag(0);
-            user.setStatus(1);
-            user.setDeleteFlag(0);
-            user.setIsOnline(1);
-            user.setIsRecommended(0);
-            user.setOrderReceivingStatus(0);
-            lawyerUserMapper.insert(user);
-            lawyerUserDto.getProblemScenarioIds().forEach(item -> {
-                LawyerServiceArea lawyerServiceArea = new LawyerServiceArea();
-                lawyerServiceArea.setLawyerUserId(user.getId());
-                lawyerServiceArea.setProblemScenarioId(item);
-                lawyerServiceArea.setCreatedTime(new Date());
-                lawyerServiceAreaMapper.insert(lawyerServiceArea);
-            });
-            LambdaQueryWrapper<LawyerUser> lawFirmLambdaQueryWrapper = new LambdaQueryWrapper<>();
-            lawFirmLambdaQueryWrapper.eq(LawyerUser::getFirmId, lawyerUserDto.getFirmId());
-            List<LawyerUser> lawyerUsers = lawyerUserMapper.selectList(lawFirmLambdaQueryWrapper);
-            if (ObjectUtils.isNotEmpty(lawyerUsers)) {
-                String lawFirmIds = lawyerUsers.stream().map(u -> String.valueOf(u.getFirmId())).filter(Objects::nonNull).distinct().collect(Collectors.joining(","));
-                LawFirm lawFirm = new LawFirm();
-                lawFirm.setId(lawyerUserDto.getFirmId());
-                lawFirmMapper.updateById(lawFirm);
-            }
-            user.setPassType(0);
-            return createToKen(user);
-        }
-    }
-
-    @Override
-    public R checkMsgCode(LawyerUserDto lawyerUserDto) {
-        String string = baseRedisService.getString("lawyer_" + lawyerUserDto.getPhone());
-        if (StringUtils.isNotEmpty(string)) {
-            if (lawyerUserDto.getMsgCode().equals(string)) {
-                LawyerUser lawyerUser = lawyerUserMapper.selectOne(new LambdaQueryWrapper<LawyerUser>()
-                        .eq(LawyerUser::getPhone, lawyerUserDto.getPhone()));
-                return R.data(lawyerUser);
-            }else {
-                return R.fail("验证码错误");
-            }
-        }else {
-            return R.fail("验证码已过期");
-        }
-    }
-
-}
+//package shop.alien.gateway.service.impl;
+//
+//import com.alibaba.fastjson.JSONObject;
+//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+//import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+//import com.baomidou.mybatisplus.core.toolkit.StringUtils;
+//import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+//import lombok.RequiredArgsConstructor;
+//import org.springframework.beans.BeanUtils;
+//import org.springframework.beans.factory.annotation.Value;
+//import org.springframework.stereotype.Service;
+//import org.springframework.transaction.annotation.Transactional;
+//import shop.alien.entity.result.R;
+//import shop.alien.entity.store.LawFirm;
+//import shop.alien.entity.store.LawyerServiceArea;
+//import shop.alien.entity.store.LawyerUser;
+//import shop.alien.entity.store.dto.LawyerUserDto;
+//import shop.alien.entity.store.vo.LawyerUserVo;
+//import shop.alien.gateway.config.BaseRedisService;
+//import shop.alien.gateway.mapper.LawyerServiceAreaMapper;
+//import shop.alien.gateway.mapper.LawyerUserMapper;
+//import shop.alien.util.common.JwtUtil;
+//
+//import java.util.*;
+//import java.util.stream.Collectors;
+//
+///**
+// * 二期-门店用户 服务实现类
+// *
+// * @author ssk
+// * @since 2024-12-11
+// */
+//@Transactional
+//@Service
+//@RequiredArgsConstructor
+//public class LawyerUserLogInServiceImpl extends ServiceImpl<LawyerUserMapper, LawyerUser> implements LawyerUserLogInService {
+//
+//    @Value("${jwt.expiration-time}")
+//    private String effectiveTime;
+//
+//    /**
+//     * 设定初始化默认密码
+//     */
+//
+//    private final BaseRedisService baseRedisService;
+//    private final LawyerUserMapper lawyerUserMapper;
+//    private final LawyerServiceAreaMapper lawyerServiceAreaMapper;
+//    private final LawFirmMapper lawFirmMapper;
+//
+//    /**
+//     * token
+//     *
+//     * @param lawyerUser
+//     * @return
+//     */
+//    @Override
+//    public R<LawyerUserVo> createToKen(LawyerUser lawyerUser) {
+//        int effectiveTimeInt = Integer.parseInt(effectiveTime.substring(0, effectiveTime.length() - 1));
+//        String effectiveTimeUnit = effectiveTime.substring(effectiveTime.length() - 1);
+//        long effectiveTimeIntLong = 0L;
+//        switch (effectiveTimeUnit) {
+//            case "s": {
+//                effectiveTimeIntLong = effectiveTimeInt * 1000L;
+//                break;
+//            }
+//            case "m": {
+//                effectiveTimeIntLong = effectiveTimeInt * 60L * 1000L;
+//                break;
+//            }
+//            case "h": {
+//                effectiveTimeIntLong = effectiveTimeInt * 60L * 60L * 1000L;
+//                break;
+//            }
+//            case "d": {
+//                effectiveTimeIntLong = effectiveTimeInt * 24L * 60L * 60L * 1000L;
+//                break;
+//            }
+//        }
+//
+//        LawyerUserVo lawyerUserVo = new LawyerUserVo();
+//        BeanUtils.copyProperties(lawyerUser, lawyerUserVo);
+//        Map<String, String> tokenMap = new HashMap<>();
+//        tokenMap.put("phone", lawyerUser.getPhone());
+//        tokenMap.put("userName", lawyerUser.getName());
+//        tokenMap.put("userId", lawyerUser.getId().toString());
+//        tokenMap.put("userType", "lawyer");
+//        tokenMap.put("passType", lawyerUser.getPassType().toString());
+//        lawyerUserVo.setToken(JwtUtil.createJWT("lawyer_" + lawyerUser.getPhone(), lawyerUser.getName(), JSONObject.toJSONString(tokenMap), effectiveTimeIntLong));
+//        baseRedisService.setString("lawyer_" + lawyerUser.getPhone(), lawyerUserVo.getToken());
+//        return R.data(lawyerUserVo);
+//    }
+//
+//    @Override
+//    public R<LawyerUserVo> logIn(LawyerUserDto lawyerUserDto) {
+//        LawyerUser lawyerUser = lawyerUserMapper.selectOne(new LambdaQueryWrapper<LawyerUser>()
+//                .eq(LawyerUser::getPhone, lawyerUserDto.getPhone()).last("limit 1"));
+//        if (ObjectUtils.isNotEmpty(lawyerUser)) {
+//            if (lawyerUser.getStatus() == 0) {
+//                return R.fail("账号被禁用");
+//            }
+//            lawyerUser.setPassType(1);
+//            return createToKen(lawyerUser);
+//        }else {
+//            LawyerUser user = new LawyerUser();
+//            BeanUtils.copyProperties(lawyerUserDto, user);
+//            user.setLogoutFlag(0);
+//            user.setStatus(1);
+//            user.setDeleteFlag(0);
+//            user.setIsOnline(1);
+//            user.setIsRecommended(0);
+//            user.setOrderReceivingStatus(0);
+//            lawyerUserMapper.insert(user);
+//            lawyerUserDto.getProblemScenarioIds().forEach(item -> {
+//                LawyerServiceArea lawyerServiceArea = new LawyerServiceArea();
+//                lawyerServiceArea.setLawyerUserId(user.getId());
+//                lawyerServiceArea.setProblemScenarioId(item);
+//                lawyerServiceArea.setCreatedTime(new Date());
+//                lawyerServiceAreaMapper.insert(lawyerServiceArea);
+//            });
+//            LambdaQueryWrapper<LawyerUser> lawFirmLambdaQueryWrapper = new LambdaQueryWrapper<>();
+//            lawFirmLambdaQueryWrapper.eq(LawyerUser::getFirmId, lawyerUserDto.getFirmId());
+//            List<LawyerUser> lawyerUsers = lawyerUserMapper.selectList(lawFirmLambdaQueryWrapper);
+//            if (ObjectUtils.isNotEmpty(lawyerUsers)) {
+//                String lawFirmIds = lawyerUsers.stream().map(u -> String.valueOf(u.getFirmId())).filter(Objects::nonNull).distinct().collect(Collectors.joining(","));
+//                LawFirm lawFirm = new LawFirm();
+//                lawFirm.setId(lawyerUserDto.getFirmId());
+//                lawFirmMapper.updateById(lawFirm);
+//            }
+//            user.setPassType(0);
+//            return createToKen(user);
+//        }
+//    }
+//
+//    @Override
+//    public R checkMsgCode(LawyerUserDto lawyerUserDto) {
+//        String string = baseRedisService.getString("lawyer_" + lawyerUserDto.getPhone());
+//        if (StringUtils.isNotEmpty(string)) {
+//            if (lawyerUserDto.getMsgCode().equals(string)) {
+//                LawyerUser lawyerUser = lawyerUserMapper.selectOne(new LambdaQueryWrapper<LawyerUser>()
+//                        .eq(LawyerUser::getPhone, lawyerUserDto.getPhone()));
+//                return R.data(lawyerUser);
+//            }else {
+//                return R.fail("验证码错误");
+//            }
+//        }else {
+//            return R.fail("验证码已过期");
+//        }
+//    }
+//
+//}

+ 1 - 0
alien-store/src/main/java/shop/alien/store/controller/LawyerUserController.java

@@ -11,6 +11,7 @@ import shop.alien.store.service.LawyerUserService;
 import shop.alien.util.myBaticsPlus.QueryBuilder;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * 律师用户 前端控制器