forked from lilishop/lilishop
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bf8f8d9
commit eddf3ec
Showing
7 changed files
with
363 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/** 新增已退货数量 **/ | ||
ALTER TABLE li_order_item ADD return_goods_number int DEFAULT 0 COMMENT '退货数量 '; |
47 changes: 47 additions & 0 deletions
47
manager-api/src/main/java/cn/lili/controller/hotwords/HotWordsManagerController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package cn.lili.controller.hotwords; | ||
|
||
import cn.lili.common.enums.ResultUtil; | ||
import cn.lili.common.vo.ResultMessage; | ||
import cn.lili.modules.search.entity.dto.HotWordsDTO; | ||
import cn.lili.modules.search.service.EsGoodsSearchService; | ||
import io.swagger.annotations.Api; | ||
import io.swagger.annotations.ApiOperation; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.validation.annotation.Validated; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
/** | ||
* 管理端,app版本控制器 | ||
* | ||
* @author Chopper | ||
* @since 2018-07-04 21:50:52 | ||
*/ | ||
@RestController | ||
@Api(tags = "管理端,系统设置扩展接口") | ||
@RequestMapping("/manager/hotwords/hotwords") | ||
public class HotWordsManagerController { | ||
|
||
@Autowired | ||
private EsGoodsSearchService esGoodsSearchService; | ||
|
||
@ApiOperation(value = "获取热词") | ||
@GetMapping | ||
public ResultMessage<Object> getHotWords() { | ||
return ResultUtil.data(esGoodsSearchService.getHotWords(100)); | ||
} | ||
|
||
@ApiOperation(value = "设置热词") | ||
@PostMapping | ||
public ResultMessage<Object> paymentForm(@Validated HotWordsDTO hotWords) { | ||
esGoodsSearchService.setHotWords(hotWords); | ||
return ResultUtil.success(); | ||
} | ||
|
||
@ApiOperation(value = "设置热词") | ||
@DeleteMapping("/{words}") | ||
public ResultMessage<Object> deleteWords(@PathVariable String words) { | ||
esGoodsSearchService.deleteHotWords(words); | ||
return ResultUtil.success(); | ||
} | ||
|
||
} |
87 changes: 87 additions & 0 deletions
87
manager-api/src/main/java/cn/lili/controller/other/AppVersionManagerController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
package cn.lili.controller.other; | ||
|
||
import cn.lili.common.enums.ResultCode; | ||
import cn.lili.common.exception.ServiceException; | ||
import cn.lili.mybatis.util.PageUtil; | ||
import cn.lili.common.enums.ResultUtil; | ||
import cn.lili.common.utils.StringUtils; | ||
import cn.lili.common.vo.PageVO; | ||
import cn.lili.common.vo.ResultMessage; | ||
import cn.lili.modules.system.entity.dos.AppVersion; | ||
import cn.lili.modules.system.service.AppVersionService; | ||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
import com.baomidou.mybatisplus.core.metadata.IPage; | ||
import io.swagger.annotations.Api; | ||
import io.swagger.annotations.ApiImplicitParam; | ||
import io.swagger.annotations.ApiImplicitParams; | ||
import io.swagger.annotations.ApiOperation; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
import javax.validation.Valid; | ||
|
||
/** | ||
* 管理端,app版本控制器 | ||
* | ||
* @author Chopper | ||
* @since 2018-07-04 21:50:52 | ||
*/ | ||
@RestController | ||
@Api("管理端,app版本控制器") | ||
@RequestMapping("/manager/other/appVersion") | ||
public class AppVersionManagerController { | ||
@Autowired | ||
private AppVersionService appVersionService; | ||
|
||
|
||
@ApiOperation(value = "查询app升级消息", response = AppVersion.class) | ||
@GetMapping | ||
@ApiImplicitParams({ | ||
@ApiImplicitParam(name = "type", value = "APP类型", required = true, dataType = "type", paramType = "query") | ||
}) | ||
public ResultMessage<IPage<AppVersion>> getByPage(PageVO page, String type) { | ||
return ResultUtil.data(this.appVersionService.page(PageUtil.initPage(page), | ||
new QueryWrapper<AppVersion>().eq(StringUtils.isNotEmpty(type), "type", type).orderByDesc("create_time"))); | ||
} | ||
|
||
|
||
@ApiOperation(value = "添加app版本信息", response = AppVersion.class) | ||
@PostMapping | ||
public ResultMessage<Object> add(@Valid AppVersion appVersion) { | ||
|
||
if(this.appVersionService.checkAppVersion(appVersion)){ | ||
if(this.appVersionService.save(appVersion)){ | ||
return ResultUtil.success(); | ||
} | ||
} | ||
throw new ServiceException(ResultCode.ERROR); | ||
} | ||
|
||
@PutMapping(value = "/{id}") | ||
@ApiOperation(value = "修改app版本信息", response = AppVersion.class) | ||
@ApiImplicitParams({ | ||
@ApiImplicitParam(name = "id", value = "主键", required = true, dataType = "String", paramType = "path") | ||
}) | ||
public ResultMessage<Object> edit(@Valid AppVersion appVersion, @PathVariable String id) { | ||
|
||
if(this.appVersionService.checkAppVersion(appVersion)){ | ||
if(this.appVersionService.updateById(appVersion)){ | ||
return ResultUtil.success(); | ||
} | ||
} | ||
throw new ServiceException(ResultCode.ERROR); | ||
} | ||
|
||
@DeleteMapping(value = "/{id}") | ||
@ApiOperation(value = "删除app版本") | ||
@ApiImplicitParams({ | ||
@ApiImplicitParam(name = "id", value = "要删除的app版本主键", required = true, dataType = "String", paramType = "path") | ||
}) | ||
public ResultMessage<Boolean> delete(@PathVariable String id) { | ||
if(this.appVersionService.removeById(id)){ | ||
return ResultUtil.success(); | ||
} | ||
throw new ServiceException(ResultCode.ERROR); | ||
} | ||
|
||
} |
67 changes: 67 additions & 0 deletions
67
manager-api/src/main/java/cn/lili/controller/other/LogisticsManagerController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
package cn.lili.controller.other; | ||
|
||
import cn.lili.common.enums.ResultUtil; | ||
import cn.lili.common.vo.PageVO; | ||
import cn.lili.common.vo.ResultMessage; | ||
import cn.lili.modules.system.entity.dos.Logistics; | ||
import cn.lili.modules.system.service.LogisticsService; | ||
import cn.lili.mybatis.util.PageUtil; | ||
import com.baomidou.mybatisplus.core.metadata.IPage; | ||
import io.swagger.annotations.Api; | ||
import io.swagger.annotations.ApiImplicitParam; | ||
import io.swagger.annotations.ApiOperation; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
import javax.validation.Valid; | ||
import javax.validation.constraints.NotNull; | ||
|
||
/** | ||
* 管理端,物流公司接口 | ||
* | ||
* @author Chopper | ||
* @since 2020/11/17 7:56 下午 | ||
*/ | ||
@RestController | ||
@Api(tags = "管理端,物流公司接口") | ||
@RequestMapping("/manager/other/logistics") | ||
public class LogisticsManagerController { | ||
@Autowired | ||
private LogisticsService logisticsService; | ||
|
||
@ApiOperation(value = "通过id获取物流公司") | ||
@GetMapping(value = "/get/{id}") | ||
public ResultMessage<Logistics> get(@PathVariable String id) { | ||
return ResultUtil.data(logisticsService.getById(id)); | ||
} | ||
|
||
@ApiOperation(value = "分页获取物流公司") | ||
@GetMapping(value = "/getByPage") | ||
public ResultMessage<IPage<Logistics>> getByPage(PageVO page) { | ||
return ResultUtil.data(logisticsService.page(PageUtil.initPage(page))); | ||
} | ||
|
||
@ApiOperation(value = "编辑物流公司") | ||
@ApiImplicitParam(name = "id", value = "物流公司ID", required = true, paramType = "path", dataType = "string") | ||
@PutMapping(value = "/{id}") | ||
public ResultMessage<Logistics> update(@NotNull @PathVariable String id, @Valid Logistics logistics) { | ||
logistics.setId(id); | ||
logisticsService.updateById(logistics); | ||
return ResultUtil.data(logistics); | ||
} | ||
|
||
@ApiOperation(value = "添加物流公司") | ||
@PostMapping(value = "/save") | ||
public ResultMessage<Logistics> save(@Valid Logistics logistics) { | ||
logisticsService.save(logistics); | ||
return ResultUtil.data(logistics); | ||
} | ||
|
||
@ApiOperation(value = "删除物流公司") | ||
@ApiImplicitParam(name = "id", value = "物流公司ID", required = true, dataType = "String", paramType = "path") | ||
@DeleteMapping(value = "/delete/{id}") | ||
public ResultMessage<Object> delAllByIds(@PathVariable String id) { | ||
logisticsService.removeById(id); | ||
return ResultUtil.success(); | ||
} | ||
} |
89 changes: 89 additions & 0 deletions
89
manager-api/src/main/java/cn/lili/controller/passport/MemberManagerController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
package cn.lili.controller.passport; | ||
|
||
import cn.lili.common.aop.annotation.DemoSite; | ||
import cn.lili.common.aop.annotation.PreventDuplicateSubmissions; | ||
import cn.lili.common.enums.ResultUtil; | ||
import cn.lili.common.vo.PageVO; | ||
import cn.lili.common.vo.ResultMessage; | ||
import cn.lili.modules.member.entity.dos.Member; | ||
import cn.lili.modules.member.entity.dto.ManagerMemberEditDTO; | ||
import cn.lili.modules.member.entity.dto.MemberAddDTO; | ||
import cn.lili.modules.member.entity.vo.MemberSearchVO; | ||
import cn.lili.modules.member.entity.vo.MemberVO; | ||
import cn.lili.modules.member.service.MemberService; | ||
import com.baomidou.mybatisplus.core.metadata.IPage; | ||
import io.swagger.annotations.Api; | ||
import io.swagger.annotations.ApiImplicitParam; | ||
import io.swagger.annotations.ApiImplicitParams; | ||
import io.swagger.annotations.ApiOperation; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
import javax.validation.Valid; | ||
import java.util.List; | ||
|
||
/** | ||
* 管理端,会员接口 | ||
* | ||
* @author Bulbasaur | ||
* @since 2020-02-25 14:10:16 | ||
*/ | ||
@RestController | ||
@Api(tags = "管理端,会员接口") | ||
@RequestMapping("/manager/passport/member") | ||
public class MemberManagerController { | ||
@Autowired | ||
private MemberService memberService; | ||
|
||
@ApiOperation(value = "会员分页列表") | ||
@GetMapping | ||
public ResultMessage<IPage<MemberVO>> getByPage(MemberSearchVO memberSearchVO, PageVO page) { | ||
return ResultUtil.data(memberService.getMemberPage(memberSearchVO, page)); | ||
} | ||
|
||
|
||
@ApiOperation(value = "通过ID获取会员信息") | ||
@ApiImplicitParam(name = "id", value = "会员ID", required = true, dataType = "String", paramType = "path") | ||
@GetMapping(value = "/{id}") | ||
public ResultMessage<Member> get(@PathVariable String id) { | ||
|
||
return ResultUtil.data(memberService.getById(id)); | ||
} | ||
|
||
@ApiOperation(value = "添加会员") | ||
@PostMapping | ||
public ResultMessage<Member> save(@Valid MemberAddDTO member) { | ||
|
||
return ResultUtil.data(memberService.addMember(member)); | ||
} | ||
|
||
@DemoSite | ||
@PreventDuplicateSubmissions | ||
@ApiOperation(value = "修改会员基本信息") | ||
@PutMapping | ||
public ResultMessage<Member> update(@Valid ManagerMemberEditDTO managerMemberEditDTO) { | ||
return ResultUtil.data(memberService.updateMember(managerMemberEditDTO)); | ||
} | ||
|
||
@DemoSite | ||
@PreventDuplicateSubmissions | ||
@ApiOperation(value = "修改会员状态,开启关闭会员") | ||
@ApiImplicitParams({ | ||
@ApiImplicitParam(name = "memberIds", value = "会员ID", required = true, dataType = "String", allowMultiple = true, paramType = "query"), | ||
@ApiImplicitParam(name = "disabled", required = true, dataType = "boolean", paramType = "query") | ||
}) | ||
@PutMapping("/updateMemberStatus") | ||
public ResultMessage<Object> updateMemberStatus(@RequestParam List<String> memberIds, @RequestParam Boolean disabled) { | ||
memberService.updateMemberStatus(memberIds, disabled); | ||
return ResultUtil.success(); | ||
} | ||
|
||
|
||
@ApiOperation(value = "根据条件查询会员总数") | ||
@GetMapping("/num") | ||
public ResultMessage<Long> getByPage(MemberSearchVO memberSearchVO) { | ||
return ResultUtil.data(memberService.getMemberNum(memberSearchVO)); | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
seller-api/src/main/java/cn/lili/controller/other/LogisticsStoreController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
package cn.lili.controller.other; | ||
|
||
|
||
import cn.lili.common.enums.ResultUtil; | ||
import cn.lili.common.security.context.UserContext; | ||
import cn.lili.common.vo.ResultMessage; | ||
import cn.lili.modules.member.service.StoreLogisticsService; | ||
import cn.lili.modules.store.entity.dos.StoreLogistics; | ||
import cn.lili.modules.system.entity.vo.StoreLogisticsVO; | ||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
import io.swagger.annotations.Api; | ||
import io.swagger.annotations.ApiImplicitParam; | ||
import io.swagger.annotations.ApiOperation; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
import java.util.List; | ||
import java.util.Objects; | ||
|
||
/** | ||
* 店铺端,物流公司接口 | ||
* | ||
* @author Bulbasaur | ||
* @since 2020/11/22 14:23 | ||
*/ | ||
@RestController | ||
@Api(tags = "店铺端,物流公司接口") | ||
@RequestMapping("/store/other/logistics") | ||
public class LogisticsStoreController { | ||
|
||
/** | ||
* 物流公司 | ||
*/ | ||
@Autowired | ||
private StoreLogisticsService storeLogisticsService; | ||
|
||
@ApiOperation(value = "获取商家物流公司列表,如果已选择则checked有值") | ||
@GetMapping | ||
public ResultMessage<List<StoreLogisticsVO>> get() { | ||
String storeId = Objects.requireNonNull(UserContext.getCurrentUser()).getStoreId(); | ||
return ResultUtil.data(storeLogisticsService.getStoreLogistics(storeId)); | ||
} | ||
|
||
@ApiOperation(value = "获取商家已选择物流公司列表") | ||
@GetMapping("/getChecked") | ||
public ResultMessage<List<StoreLogisticsVO>> getChecked() { | ||
String storeId = Objects.requireNonNull(UserContext.getCurrentUser()).getStoreId(); | ||
return ResultUtil.data(storeLogisticsService.getStoreSelectedLogistics(storeId)); | ||
} | ||
|
||
@ApiOperation(value = "选择物流公司") | ||
@ApiImplicitParam(name = "logisticsId", value = "物流公司ID", required = true, paramType = "path") | ||
@PostMapping("/{logisticsId}") | ||
public ResultMessage<StoreLogistics> checked(@PathVariable String logisticsId) { | ||
String storeId = Objects.requireNonNull(UserContext.getCurrentUser()).getStoreId(); | ||
return ResultUtil.data(storeLogisticsService.add(logisticsId, storeId)); | ||
} | ||
|
||
|
||
@ApiOperation(value = "取消选择物流公司") | ||
@ApiImplicitParam(name = "id", value = "物流公司ID", required = true, paramType = "path") | ||
@DeleteMapping(value = "/{id}") | ||
public ResultMessage<Object> cancel(@PathVariable String id) { | ||
String storeId = Objects.requireNonNull(UserContext.getCurrentUser()).getStoreId(); | ||
boolean remove = storeLogisticsService.remove(new LambdaQueryWrapper<StoreLogistics>().eq(StoreLogistics::getId, id).eq(StoreLogistics::getStoreId, storeId)); | ||
return ResultUtil.data(remove); | ||
} | ||
|
||
} |