|
@@ -0,0 +1,156 @@
|
|
|
+package com.gree.mall.contest.controller.pc.common;
|
|
|
+
|
|
|
+
|
|
|
+import cn.hutool.core.lang.TypeReference;
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.gree.mall.contest.annotation.ApiNotAuth;
|
|
|
+import com.gree.mall.contest.annotation.ZfireList;
|
|
|
+import com.gree.mall.contest.bean.common.AmityUrlVO;
|
|
|
+import com.gree.mall.contest.bean.common.ImgCarouselManageBean;
|
|
|
+import com.gree.mall.contest.bean.zfire.ZfireParamBean;
|
|
|
+import com.gree.mall.contest.helper.ResponseHelper;
|
|
|
+import com.gree.mall.contest.logic.common.CompanyRecordLogic;
|
|
|
+import com.gree.mall.contest.plus.entity.AmityUrl;
|
|
|
+import com.gree.mall.contest.plus.entity.CompanyRecordManage;
|
|
|
+import com.gree.mall.contest.plus.entity.ImgCarouselManage;
|
|
|
+import io.swagger.v3.oas.annotations.Operation;
|
|
|
+import io.swagger.v3.oas.annotations.Parameter;
|
|
|
+import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+
|
|
|
+@Slf4j
|
|
|
+@RestController
|
|
|
+@Tag(name = "公司备案API", description = "公司备案API")
|
|
|
+@RequestMapping(value = "/pcapi/record", produces = "application/json; charset=utf-8")
|
|
|
+@RequiredArgsConstructor
|
|
|
+public class CompanyRecordController {
|
|
|
+
|
|
|
+ private final CompanyRecordLogic companyRecordLogic;
|
|
|
+
|
|
|
+ @PostMapping("company/add")
|
|
|
+ @Operation(summary = "新增公司备案信息")
|
|
|
+ public ResponseHelper addRecordCompany(@RequestBody CompanyRecordManage companyRecordManage) {
|
|
|
+ companyRecordLogic.addRecordCompany(companyRecordManage);
|
|
|
+ return ResponseHelper.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("company/update")
|
|
|
+ @Operation(summary = "修改")
|
|
|
+ public ResponseHelper editRecordCompany(@RequestBody CompanyRecordManage companyRecordManage) {
|
|
|
+ companyRecordLogic.editRecordCompany(companyRecordManage);
|
|
|
+ return ResponseHelper.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiNotAuth
|
|
|
+ @GetMapping("company/list")
|
|
|
+ @Operation(summary = "公司列表")
|
|
|
+ public ResponseHelper<List<CompanyRecordManage>> companyRecordList() {
|
|
|
+ List<CompanyRecordManage> companyRecordManage = companyRecordLogic.companyRecordList();
|
|
|
+ return ResponseHelper.success(companyRecordManage);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiNotAuth
|
|
|
+ @GetMapping("company/detail")
|
|
|
+ @Operation(summary = "查询")
|
|
|
+ public ResponseHelper<CompanyRecordManage> getCompany(@RequestParam String id) {
|
|
|
+ CompanyRecordManage imgCarouselManage = companyRecordLogic.getCompany(id);
|
|
|
+ return ResponseHelper.success(imgCarouselManage);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("carousel/add")
|
|
|
+ @Operation(summary = "新增轮播图信息")
|
|
|
+ public ResponseHelper addImgCarousel(@RequestBody ImgCarouselManage imgCarouselManage) {
|
|
|
+ companyRecordLogic.addImgCarousel(imgCarouselManage);
|
|
|
+ return ResponseHelper.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiNotAuth
|
|
|
+ @GetMapping("list")
|
|
|
+ @Operation(summary = "轮播图列表")
|
|
|
+ public ResponseHelper<List<ImgCarouselManage>> list() {
|
|
|
+ List<ImgCarouselManage> adminRoleIPage = companyRecordLogic.list();
|
|
|
+ return ResponseHelper.success(adminRoleIPage);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("delete")
|
|
|
+ @Operation(summary = "批量删除轮播图")
|
|
|
+ public ResponseHelper delete(@RequestParam List<String> ids) {
|
|
|
+ companyRecordLogic.delete(ids);
|
|
|
+ return ResponseHelper.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiNotAuth
|
|
|
+ @GetMapping("detail")
|
|
|
+ @Operation(summary = "查询")
|
|
|
+ public ResponseHelper<ImgCarouselManage> get(@RequestParam String id) {
|
|
|
+ ImgCarouselManage imgCarouselManage = companyRecordLogic.detail(id);
|
|
|
+ return ResponseHelper.success(imgCarouselManage);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("update")
|
|
|
+ @Operation(summary = "修改")
|
|
|
+ public ResponseHelper update(@RequestBody ImgCarouselManageBean imgCarouselManage) {
|
|
|
+ companyRecordLogic.update(imgCarouselManage);
|
|
|
+ return ResponseHelper.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("updateImgStatus")
|
|
|
+ @Operation(summary = "轮播图显示与隐藏")
|
|
|
+ public ResponseHelper weatherShow(@RequestParam String id) {
|
|
|
+ companyRecordLogic.updateStatus(id);
|
|
|
+ return ResponseHelper.success();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @PostMapping("amity/add")
|
|
|
+ @Operation(summary = "友情链接-新增")
|
|
|
+ public ResponseHelper addAmity(@RequestBody AmityUrl amityUrl) {
|
|
|
+ companyRecordLogic.addAmity(amityUrl);
|
|
|
+ return ResponseHelper.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("amity/update")
|
|
|
+ @Operation(summary = "友情链接-修改")
|
|
|
+ public ResponseHelper updateAmity(@RequestBody AmityUrl amityUrl) {
|
|
|
+ companyRecordLogic.updateAmity(amityUrl);
|
|
|
+ return ResponseHelper.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("amity/delete")
|
|
|
+ @Operation(summary = "友情链接-批量删除")
|
|
|
+ public ResponseHelper deleteAmity(@RequestParam List<String> amityUrlIds) {
|
|
|
+ companyRecordLogic.deleteAmity(amityUrlIds);
|
|
|
+ return ResponseHelper.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("amity/status")
|
|
|
+ @Operation(summary = "友情链接-状态 有效/无效")
|
|
|
+ public ResponseHelper amityStatus(@RequestParam String amityUrlId, @Parameter(required = true, name = "YES NO") @RequestParam String status) {
|
|
|
+ companyRecordLogic.amityStatus(amityUrlId, status);
|
|
|
+ return ResponseHelper.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiNotAuth
|
|
|
+ @ZfireList
|
|
|
+ @PostMapping("amity/list")
|
|
|
+ @Operation(summary = "友情链接-列表")
|
|
|
+ public ResponseHelper<IPage<AmityUrlVO>> amityList(@RequestBody ZfireParamBean zfireParamBean) {
|
|
|
+ IPage<AmityUrlVO> list = companyRecordLogic.amityList(zfireParamBean);
|
|
|
+ return ResponseHelper.success(list, new TypeReference<AmityUrlVO>() {
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiNotAuth
|
|
|
+ @PostMapping("amity/list2")
|
|
|
+ @Operation(summary = "友情链接-列表")
|
|
|
+ public ResponseHelper<List<AmityUrl>> amityList() {
|
|
|
+ List<AmityUrl> amityUrls = companyRecordLogic.list2();
|
|
|
+ return ResponseHelper.success(amityUrls);
|
|
|
+ }
|
|
|
+
|
|
|
+}
|