Merge branch 'master-password' into dev
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.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.annotations.ApiParam;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
@ -27,12 +24,9 @@ public class UserPasswordController{
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiOperation("查询数据")
|
@ApiOperation("查询数据")
|
||||||
@GetMapping("/getPassword")
|
@PostMapping("/validatePassword")
|
||||||
public BaseResponse<UserPassword> getPassword(){
|
public BaseResponse<Boolean> validatePassword(@RequestParam String code){
|
||||||
|
return BaseResponse.success(iuserPasswordService.validatePassword(code));
|
||||||
UserPassword userPassword = iuserPasswordService.list().get(0);
|
|
||||||
|
|
||||||
return BaseResponse.success(userPassword);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -12,5 +12,5 @@ import com.chinaunicom.mall.ebtp.extend.userpassword.entity.UserPassword;
|
|||||||
public interface IUserPasswordService extends IService<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.dao.UserPasswordMapper;
|
||||||
import com.chinaunicom.mall.ebtp.extend.userpassword.entity.UserPassword;
|
import com.chinaunicom.mall.ebtp.extend.userpassword.entity.UserPassword;
|
||||||
import com.chinaunicom.mall.ebtp.extend.userpassword.service.IUserPasswordService;
|
import com.chinaunicom.mall.ebtp.extend.userpassword.service.IUserPasswordService;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
/**
|
/**
|
||||||
* 对数据表 user_password 操作的 serviceImpl
|
* 对数据表 user_password 操作的 serviceImpl
|
||||||
@ -13,5 +14,12 @@ import org.springframework.stereotype.Service;
|
|||||||
@Service
|
@Service
|
||||||
public class UserPasswordServiceImpl extends ServiceImpl<UserPasswordMapper, UserPassword> implements IUserPasswordService {
|
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