Commit 2f7c1c31 authored by 周健威's avatar 周健威

添加banner修改

parent 46fd063a
...@@ -123,4 +123,22 @@ public class Banner { ...@@ -123,4 +123,22 @@ public class Banner {
* html 标签悬浮显示 seo 需要 * html 标签悬浮显示 seo 需要
*/ */
private String alt; private String alt;
/**
* 跳转类型 0--不跳转;1--商品详情页;2--店铺主页;
*/
@Column(name = "jump_type")
private Integer jumpType;
/**
* 跳转 商品/店铺 id;
*/
@Column(name = "jump_id")
private Integer jumpId;
/**
* 状态 1--上架;2--下架
*/
@Column(name = "status")
private Integer status;
} }
package com.xxfc.platform.app.rest.admin; package com.xxfc.platform.app.rest.admin;
import com.github.wxiaoqi.security.admin.feign.UserFeign;
import com.github.wxiaoqi.security.admin.feign.dto.UserDTO; import com.github.wxiaoqi.security.admin.feign.dto.UserDTO;
import com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.vo.PageDataVO; import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.app.biz.BannerBiz; import com.xxfc.platform.app.biz.BannerBiz;
...@@ -22,11 +24,19 @@ import org.springframework.web.bind.annotation.*; ...@@ -22,11 +24,19 @@ import org.springframework.web.bind.annotation.*;
@RestController @RestController
@RequestMapping("/admin/banner") @RequestMapping("/admin/banner")
@Api(value = "banner后台接口", tags = "banner后台接口") @Api(value = "banner后台接口", tags = "banner后台接口")
public class BannerAdminController { public class BannerAdminController implements UserRestInterface {
@Autowired @Autowired
private BannerBiz bannerBiz; private BannerBiz bannerBiz;
@Autowired
private UserFeign userFeign;
@Override
public UserFeign getUserFeign() {
return userFeign;
}
/** /**
* 修改 * 修改
* *
...@@ -36,6 +46,7 @@ public class BannerAdminController { ...@@ -36,6 +46,7 @@ public class BannerAdminController {
@PutMapping @PutMapping
@ApiOperation(value = "banner修改", notes = "修改") @ApiOperation(value = "banner修改", notes = "修改")
public ObjectRestResponse<Banner> update(@RequestBody Banner banner, UserDTO userInfo) { public ObjectRestResponse<Banner> update(@RequestBody Banner banner, UserDTO userInfo) {
userInfo = getAdminUserInfo();
int effectRows = bannerBiz.save(banner, userInfo); int effectRows = bannerBiz.save(banner, userInfo);
if (effectRows > 0) { if (effectRows > 0) {
return ObjectRestResponse.succ(); return ObjectRestResponse.succ();
...@@ -87,6 +98,7 @@ public class BannerAdminController { ...@@ -87,6 +98,7 @@ public class BannerAdminController {
@ApiOperation(value = "banner保存", notes = "banner保存") @ApiOperation(value = "banner保存", notes = "banner保存")
@PostMapping @PostMapping
public ObjectRestResponse<Void> saveBanner(@RequestBody Banner banner, UserDTO userDTO) { public ObjectRestResponse<Void> saveBanner(@RequestBody Banner banner, UserDTO userDTO) {
userDTO = getAdminUserInfo();
banner.setIsDel(0); banner.setIsDel(0);
int effectRows = bannerBiz.save(banner, userDTO); int effectRows = bannerBiz.save(banner, userDTO);
if (effectRows > 0) { if (effectRows > 0) {
......
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