diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/userpassword/controller/UserPasswordController.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/userpassword/controller/UserPasswordController.java new file mode 100644 index 0000000..5a5c097 --- /dev/null +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/userpassword/controller/UserPasswordController.java @@ -0,0 +1,33 @@ +package com.chinaunicom.mall.ebtp.extend.userpassword.controller; + + +import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse; +import com.chinaunicom.mall.ebtp.extend.userpassword.entity.UserPassword; +import com.chinaunicom.mall.ebtp.extend.userpassword.service.IUserPasswordService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; + +@RestController +@Api(tags = "") +@RequestMapping("/v1/userpassword") +public class UserPasswordController{ + + @Resource + private IUserPasswordService iuserPasswordService; + + /** + * 查询数据 + * @return + */ + @ApiOperation("查询数据") + @PostMapping("/validatePassword") + public BaseResponse validatePassword(@RequestParam("code") String code){ + return BaseResponse.success(iuserPasswordService.validatePassword(code)); + } + + +} diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/userpassword/dao/UserPasswordMapper.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/userpassword/dao/UserPasswordMapper.java new file mode 100644 index 0000000..f15ea6c --- /dev/null +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/userpassword/dao/UserPasswordMapper.java @@ -0,0 +1,13 @@ +package com.chinaunicom.mall.ebtp.extend.userpassword.dao; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.chinaunicom.mall.ebtp.extend.userpassword.entity.UserPassword; + +/** +* @author daixc +*/ +public interface UserPasswordMapper extends BaseMapper { + + +} diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/userpassword/dao/mapper/UserPasswordMapper.xml b/src/main/java/com/chinaunicom/mall/ebtp/extend/userpassword/dao/mapper/UserPasswordMapper.xml new file mode 100644 index 0000000..6551b85 --- /dev/null +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/userpassword/dao/mapper/UserPasswordMapper.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + update user_password + set + delete_flag="deleted" + where ID=#{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/userpassword/entity/UserPassword.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/userpassword/entity/UserPassword.java new file mode 100644 index 0000000..2613439 --- /dev/null +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/userpassword/entity/UserPassword.java @@ -0,0 +1,33 @@ +package com.chinaunicom.mall.ebtp.extend.userpassword.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; + +/** + * 实体类 UserPassword + * + * @auto.generated + */ +@Data +@Accessors(chain = true) +@ApiModel +@EqualsAndHashCode(callSuper = false) +@TableName(value = "user_password", autoResultMap = true) +public class UserPassword implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + @ApiModelProperty(value = "") + private String password; + + +} diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/userpassword/service/IUserPasswordService.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/userpassword/service/IUserPasswordService.java new file mode 100644 index 0000000..0231fb3 --- /dev/null +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/userpassword/service/IUserPasswordService.java @@ -0,0 +1,16 @@ +package com.chinaunicom.mall.ebtp.extend.userpassword.service; + + +import com.baomidou.mybatisplus.extension.service.IService; +import com.chinaunicom.mall.ebtp.extend.userpassword.entity.UserPassword; + +/** + * 对数据表 user_password 操作的 service + * @author Auto create + * + */ +public interface IUserPasswordService extends IService { + + + boolean validatePassword(String code); +} diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/userpassword/service/impl/UserPasswordServiceImpl.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/userpassword/service/impl/UserPasswordServiceImpl.java new file mode 100644 index 0000000..ef4d5f9 --- /dev/null +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/userpassword/service/impl/UserPasswordServiceImpl.java @@ -0,0 +1,25 @@ +package com.chinaunicom.mall.ebtp.extend.userpassword.service.impl; + +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 + * @author daixc + * + */ +@Service +public class UserPasswordServiceImpl extends ServiceImpl 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; + } +}