提交 c04672fc authored 作者: 孙洁清's avatar 孙洁清

关键技术接口根据name查询功能

上级 691e47e4
package com.zjty.inspect.controller;
import com.zjty.inspect.service.CategoryService;
import com.zjty.inspect.service.ConfigService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
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.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Slf4j
@RestController
@RequestMapping("/category")
@Api(value = "类型管理接口",description = "类型管理接口,提供页面的增、删、改、查")
public class CategoryCotroller {
@Autowired
private CategoryService categoryService;
/**
* 查询所有类型
* @return
*/
@ApiOperation("查询所有类型")
@GetMapping
public ResponseEntity getCategorys(){
return ResponseEntity.ok(categoryService.findAll());
}
}
package com.zjty.inspect.dao;
import com.zjty.inspect.entity.Category;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
public interface CategoryDao extends JpaRepository<Category,String>, JpaSpecificationExecutor<Category> {
}
...@@ -50,6 +50,10 @@ public class Technology { ...@@ -50,6 +50,10 @@ public class Technology {
@ApiModelProperty(value = "是否支持",example = "1") @ApiModelProperty(value = "是否支持",example = "1")
private Integer support; private Integer support;
/**
* 分类id
*/
private String category_id;
/** /**
* 技术类型 * 技术类型
* 1:前端技术 * 1:前端技术
......
package com.zjty.inspect.service;
import com.zjty.inspect.entity.Category;
import java.util.List;
public interface CategoryService {
List<Category> findAll();
}
package com.zjty.inspect.service.impl;
import com.zjty.inspect.dao.CategoryDao;
import com.zjty.inspect.entity.Category;
import com.zjty.inspect.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class CategoryServiceImpl implements CategoryService {
@Autowired
private CategoryDao categoryDao;
@Override
public List<Category> findAll() {
return categoryDao.findAll();
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论