Commit 118c79dc authored by liaoanyuan's avatar liaoanyuan

管理端功能修改

parent d418deb0
...@@ -59,5 +59,5 @@ public interface BannerMapper extends BaseMapper<Banner> { ...@@ -59,5 +59,5 @@ public interface BannerMapper extends BaseMapper<Banner> {
* @param status * @param status
* @return * @return
*/ */
int aditStatus(@Param("id") Integer id, @Param("status") Integer status); int editStatus(@Param("id") Integer id, @Param("status") Integer status);
} }
...@@ -37,12 +37,6 @@ public class UserInfo extends BaseEntity implements Serializable { ...@@ -37,12 +37,6 @@ public class UserInfo extends BaseEntity implements Serializable {
@ApiModelProperty(name="password",value = "用户密码") @ApiModelProperty(name="password",value = "用户密码")
private String password; private String password;
/**
* 登录来源
*/
@ApiModelProperty(name ="source",value = "登录来源:1 PC,2 WAP")
private Integer source;
/** /**
* 电话号码 * 电话号码
*/ */
......
...@@ -5,6 +5,7 @@ import cn.wisenergy.model.app.Banner; ...@@ -5,6 +5,7 @@ import cn.wisenergy.model.app.Banner;
import cn.wisenergy.model.dto.BannerDto; import cn.wisenergy.model.dto.BannerDto;
import cn.wisenergy.model.vo.AdvertisingQueryVo; import cn.wisenergy.model.vo.AdvertisingQueryVo;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.sun.org.apache.xpath.internal.operations.Bool;
/** /**
* @ Description: 广告接口定义 * @ Description: 广告接口定义
...@@ -26,7 +27,7 @@ public interface BannerService { ...@@ -26,7 +27,7 @@ public interface BannerService {
* @param advertising 广告信息 * @param advertising 广告信息
* @return true 成功 false 失败 * @return true 成功 false 失败
*/ */
R edit(Banner advertising); R<Boolean> edit(Banner advertising);
/** /**
* 获取详情 * 获取详情
...@@ -51,6 +52,6 @@ public interface BannerService { ...@@ -51,6 +52,6 @@ public interface BannerService {
* @param status 1 :投放 2:暂停投放 * @param status 1 :投放 2:暂停投放
* @return true 成功 false 失败 * @return true 成功 false 失败
*/ */
R<Boolean> aditStatus(Integer id, Integer status); R<Boolean> editStatus(Integer id, Integer status);
} }
...@@ -10,14 +10,14 @@ public interface RefillCardService { ...@@ -10,14 +10,14 @@ public interface RefillCardService {
* @param refillCard * @param refillCard
* @return * @return
*/ */
R add(RefillCard refillCard); R<Boolean> add(RefillCard refillCard);
/** /**
* 改变激活状态 * 改变激活状态
* @param batchNumber * @param batchNumber
* @return * @return
*/ */
R update(String batchNumber); R<Boolean> update(String batchNumber);
/** /**
* 查询充值卡信息 * 查询充值卡信息
......
...@@ -8,6 +8,7 @@ import cn.wisenergy.model.vo.AdvertisingQueryVo; ...@@ -8,6 +8,7 @@ import cn.wisenergy.model.vo.AdvertisingQueryVo;
import cn.wisenergy.service.app.BannerService; import cn.wisenergy.service.app.BannerService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.sun.org.apache.xpath.internal.operations.Bool;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -49,17 +50,13 @@ public class BannerServiceImpl extends ServiceImpl<BannerMapper, Banner> impleme ...@@ -49,17 +50,13 @@ public class BannerServiceImpl extends ServiceImpl<BannerMapper, Banner> impleme
} }
@Override @Override
public R edit(Banner advertising) { public R<Boolean> edit(Banner advertising) {
log.info("BannerServiceImpl[].getById[].input.param:advertising" + advertising); log.info("BannerServiceImpl[].getById[].input.param:advertising" + advertising);
if (null == advertising) { if (null == advertising) {
return R.error("输入的参数有误"); return R.error("输入的参数有误");
} }
if (advertising.getStatus() < 0 || advertising.getStatus() > 1) {
return R.error("缺少重要数据");
}
int edit = bannerMapper.edit(advertising); int edit = bannerMapper.edit(advertising);
//判断数据是否修改成功 //判断数据是否修改成功
...@@ -67,7 +64,7 @@ public class BannerServiceImpl extends ServiceImpl<BannerMapper, Banner> impleme ...@@ -67,7 +64,7 @@ public class BannerServiceImpl extends ServiceImpl<BannerMapper, Banner> impleme
return R.error("数据修改失败"); return R.error("数据修改失败");
} }
return R.ok(); return R.ok(0,true);
} }
@Override @Override
...@@ -124,26 +121,20 @@ public class BannerServiceImpl extends ServiceImpl<BannerMapper, Banner> impleme ...@@ -124,26 +121,20 @@ public class BannerServiceImpl extends ServiceImpl<BannerMapper, Banner> impleme
} }
@Override @Override
public R<Boolean> putIn(Integer id, Integer status) { public R<Boolean> editStatus(Integer id, Integer status) {
log.info("BannerServiceImpl[].putIn[].input.param,status:{},id" + status, id); log.info("BannerServiceImpl[].putIn[].input.param,status:{},id" + status, id);
//判断数据是否正确 //判断数据是否正确
if (null == id) { if (null == id ||null==status) {
return R.error("缺少重要数据");
}
if (status == null) {
return R.error("缺少重要数据");
}
if (status < 0 || status > 1) {
return R.error("缺少重要数据"); return R.error("缺少重要数据");
} }
//修改广告状态 //修改广告状态
int i = bannerMapper.putIn(id, status); int i = bannerMapper.editStatus(id, status);
//判断数据是否修改成功 //判断数据是否修改成功
if (i == 0) { if (i == 0) {
return R.error("数据修改失败"); return R.error("数据修改失败");
} }
return R.ok(); return R.ok(0,true);
} }
} }
...@@ -50,7 +50,7 @@ public class BannerController { ...@@ -50,7 +50,7 @@ public class BannerController {
@GetMapping("/getById") @GetMapping("/getById")
public R<Banner> getById(Integer id) { public R<Banner> getById(Integer id) {
log.info("BannerController[].getById[].input.param:id" + id); log.info("BannerController[].getById[].input.param:id" + id);
R<Banner> bannerR = bannerService.getById(id); R bannerR = bannerService.getById(id);
return bannerR; return bannerR;
} }
...@@ -60,9 +60,9 @@ public class BannerController { ...@@ -60,9 +60,9 @@ public class BannerController {
@ApiImplicitParam(name = "status", value = "广告状态:0:暂停中 1:投放中", dataType = "int", required = true) @ApiImplicitParam(name = "status", value = "广告状态:0:暂停中 1:投放中", dataType = "int", required = true)
}) })
@GetMapping("/putIn") @GetMapping("/putIn")
public R<Boolean> putIn(Integer id, Integer status) { public R<Boolean> editStatus(Integer id, Integer status) {
log.info("BannerController[].putIn[].input.param:id,status" + id, status); log.info("BannerController[].putIn[].input.param:id,status" + id, status);
R<Boolean> booleanR = bannerService.putIn(id, status); R<Boolean> booleanR = bannerService.editStatus(id, status);
return booleanR; return booleanR;
} }
......
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