Commit 5628e33e authored by m1991's avatar m1991

资讯模块数据——数据展示功能修复

parent d23ffc5d
......@@ -34,4 +34,12 @@ public interface ShopZxMapper extends BaseMapper<shopZx> {
shopZx selectByzxid(@Param("zxid") Integer zxid);
int updateByzxid(@Param("zxid")Integer zxid,@Param("zxLikes") Integer zxLikes);
/**
* 资讯审核
* @param zxid
* @param ZxToExamine
* @return
*/
int updateZxToExaminezxid(@Param("zxid")Integer zxid,@Param("ZxToExamine") Integer ZxToExamine);
}
......@@ -78,4 +78,16 @@
</where>
</update>
<!--资讯审核-->
<update id="updateZxToExaminezxid">
UPDATE
<include refid="table"/>
<set>
zx_to_examine = #{ZxToExamine}
</set>
<where>
zx_id = #{zxid}
</where>
</update>
</mapper>
\ No newline at end of file
......@@ -44,6 +44,15 @@ public class shopZx extends Model<shopZx> implements Serializable {
@ApiModelProperty(name = "zx_likes", value = "获赞数")
private Integer zxLikes;
public Integer getZxToExamine() {
return zxToExamine;
}
public Integer setZxToExamine(Integer zxToExamine) {
this.zxToExamine = zxToExamine;
return zxToExamine;
}
/**
* 审核字段
*/
......
......@@ -60,5 +60,12 @@ public interface UploadService {
*/
Map Ilike(Integer zxid);
/**
* TODO 资讯审核
* @param zxid
* @return
*/
Map toExamine(Integer zxid);
}
......@@ -306,4 +306,27 @@ public class UploadServiceImpl implements UploadService {
};
return map;
}
/**
* 资讯审核
* @param zxid
* @return
*/
@Override
public Map toExamine(Integer zxid) {
Map map = new HashMap();
try {
shopZx shopZx = shopZxMapper.selectByzxid(zxid);
if(null!=shopZx){
Integer ZxToExamine=shopZx.setZxToExamine(1);
shopZxMapper.updateZxToExaminezxid(zxid,ZxToExamine);
}
map.put("code",0);
map.put("msg","审核通过!");
}catch ( BaseException e){
map.put("code",1);
map.put("msg","审核失败!");
};
return map;
}
}
......@@ -79,7 +79,6 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U
@Override
public Map userByZx(String userId, String beInvitedCode) {
//查询数据库,看看是否存在该用户
// Integer yh=usersMapper.getuserIdById(userId);
User byUserId = usersMapper.getByUserId(userId);
if (null != byUserId) {
R.error(0, "该用户已存在!请直接登录!");
......
......@@ -119,4 +119,14 @@ public class UploadController {
public Map like(int zxid){
return uploadService.Ilike(zxid);
}
/**
* 审核接口
*/
@ApiImplicitParam(name = "zxid", value = "资讯ID", required = true,dataType = "integer")
@RequestMapping(method = RequestMethod.POST, value = "/toExamine")
public Map ToExamine(int zxid){
return uploadService.toExamine(zxid);
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment