平台密码
This commit is contained in:
@ -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));
|
||||
}
|
||||
|
||||
|
||||
|
@ -12,5 +12,5 @@ import com.chinaunicom.mall.ebtp.extend.userpassword.entity.UserPassword;
|
||||
public interface IUserPasswordService extends IService<UserPassword> {
|
||||
|
||||
|
||||
|
||||
boolean validatePassword(String code);
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user