平台密码

This commit is contained in:
yss
2021-06-15 16:02:18 +08:00
parent 6481d1b436
commit d405d4d10f
3 changed files with 14 additions and 12 deletions

View File

@ -7,10 +7,7 @@ import com.chinaunicom.mall.ebtp.extend.userpassword.service.IUserPasswordServic
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@ -27,12 +24,9 @@ public class UserPasswordController{
* @return
*/
@ApiOperation("查询数据")
@GetMapping("/getPassword")
public BaseResponse<UserPassword> getPassword(){
UserPassword userPassword = iuserPasswordService.list().get(0);
return BaseResponse.success(userPassword);
@PostMapping("/validatePassword")
public BaseResponse<Boolean> validatePassword(@RequestParam String code){
return BaseResponse.success(iuserPasswordService.validatePassword(code));
}

View File

@ -12,5 +12,5 @@ import com.chinaunicom.mall.ebtp.extend.userpassword.entity.UserPassword;
public interface IUserPasswordService extends IService<UserPassword> {
boolean validatePassword(String code);
}

View File

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.chinaunicom.mall.ebtp.extend.userpassword.dao.UserPasswordMapper;
import com.chinaunicom.mall.ebtp.extend.userpassword.entity.UserPassword;
import com.chinaunicom.mall.ebtp.extend.userpassword.service.IUserPasswordService;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
/**
* 对数据表 user_password 操作的 serviceImpl
@ -13,5 +14,12 @@ import org.springframework.stereotype.Service;
@Service
public class UserPasswordServiceImpl extends ServiceImpl<UserPasswordMapper, UserPassword> implements IUserPasswordService {
@Override
public boolean validatePassword(String code) {
UserPassword userPassword = this.list().get(0);
if(StringUtils.isNotBlank(code) && code.equals(userPassword.getPassword())){
return true;
}
return false;
}
}