获取字典中的应用账户信息接口

pull/1/head
DataCall 1 year ago
parent 1bbbe4dd81
commit b93ed42abe

@ -2,27 +2,34 @@ package com.cyl.h5.controller;
import com.cyl.h5.domain.vo.HomeConfigVO;
import com.cyl.manager.pms.service.ProductCategoryService;
import com.ruoyi.common.core.domain.entity.SysDictData;
import com.ruoyi.system.service.ISysConfigService;
import com.ruoyi.system.service.ISysDictTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@RequestMapping("/no-auth/home")
public class HomeController {
@RequestMapping("/no-auth")
public class NoAuthController {
@Autowired
private ISysConfigService sysConfigService;
@Autowired
private ProductCategoryService categoryService;
@Autowired
private ISysDictTypeService dictTypeService;
/**
*
*
* @return
*/
@GetMapping("/home-cfg")
@GetMapping("/home/home-cfg")
public ResponseEntity<HomeConfigVO> getHomeConfig() {
HomeConfigVO res = new HomeConfigVO();
res.setBanners(sysConfigService.selectConfigByKey("h5.home.banner"));
@ -34,11 +41,21 @@ public class HomeController {
*
* @return
*/
@GetMapping("/product-count")
@GetMapping("/home/product-count")
public ResponseEntity<HomeConfigVO> productCount() {
HomeConfigVO res = new HomeConfigVO();
res.setBanners(sysConfigService.selectConfigByKey("h5.home.banner"));
res.setCategoryList(categoryService.queryCategoryWithProductsForH5());
return ResponseEntity.ok(res);
}
/**
*
*/
@GetMapping("/app/account/{type}")
public ResponseEntity<String> wmsAccount(@PathVariable String type) {
List<SysDictData> sysAppAccount = dictTypeService.selectDictDataByType("sys_app_account");
SysDictData sysDictData = sysAppAccount.stream().filter(it -> it.getDictValue().equals(type)).findFirst().orElseGet(SysDictData::new);
return ResponseEntity.ok(sysDictData.getDictLabel());
}
}
Loading…
Cancel
Save