Commit f6fd3269 authored by 盖献康's avatar 盖献康

车企信息 - 修改 - 2

parent cbdfccf2
......@@ -2,6 +2,7 @@ package com.ruoyi.mapper;
import java.util.List;
import com.ruoyi.domain.AutomobileEnterprise;
import org.springframework.stereotype.Repository;
/**
* 车企信息Mapper接口
......@@ -9,6 +10,7 @@ import com.ruoyi.domain.AutomobileEnterprise;
* @author gxk
* @date 2024-01-05
*/
@Repository
public interface AutomobileEnterpriseMapper
{
/**
......
......@@ -11,7 +11,7 @@ import org.apache.ibatis.annotations.Mapper;
* @date 2024-01-05
*/
@Mapper
public interface IAutomobileEnterpriseService
public interface AutomobileEnterpriseService
{
/**
* 查询车企信息
......
......@@ -7,7 +7,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mapper.AutomobileEnterpriseMapper;
import com.ruoyi.domain.AutomobileEnterprise;
import com.ruoyi.service.IAutomobileEnterpriseService;
import com.ruoyi.service.AutomobileEnterpriseService;
import org.springframework.transaction.annotation.Transactional;
/**
* 车企信息Service业务层处理
......@@ -16,7 +17,8 @@ import com.ruoyi.service.IAutomobileEnterpriseService;
* @date 2024-01-05
*/
@Service
public class AutomobileEnterpriseServiceImpl implements IAutomobileEnterpriseService
@Transactional
public class AutomobileEnterpriseServiceImpl implements AutomobileEnterpriseService
{
@Autowired
private AutomobileEnterpriseMapper automobileEnterpriseMapper;
......
......@@ -5,24 +5,20 @@ import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.web.request.AutomobileEnterpriseRequest;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.domain.AutomobileEnterprise;
import com.ruoyi.service.IAutomobileEnterpriseService;
import com.ruoyi.service.AutomobileEnterpriseService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
......@@ -37,15 +33,17 @@ import com.ruoyi.common.core.page.TableDataInfo;
@RequestMapping("/system/enterprise")
public class AutomobileEnterpriseController extends BaseController
{
@Autowired
private IAutomobileEnterpriseService automobileEnterpriseService;
private AutomobileEnterpriseService automobileEnterpriseService;
/**
* 查询车企信息列表
*/
@Anonymous
@ApiOperation("分页查询车企信息列表")
@GetMapping("/list")
public TableDataInfo list(AutomobileEnterprise automobileEnterprise)
@PostMapping("/list")
public TableDataInfo<AutomobileEnterprise> list(AutomobileEnterprise automobileEnterprise)
{
startPage();
List<AutomobileEnterprise> list = automobileEnterpriseService.selectAutomobileEnterpriseList(automobileEnterprise);
......@@ -68,11 +66,12 @@ public class AutomobileEnterpriseController extends BaseController
/**
* 获取车企信息详细信息
*/
@Anonymous
@ApiOperation("获取车企信息详细信息")
@GetMapping(value = "/{id}")
public R getInfo(@PathVariable("id") Long id)
@PostMapping("/getById")
public R<AutomobileEnterprise> getInfo(@Validated @RequestBody AutomobileEnterpriseRequest request)
{
return R.ok(automobileEnterpriseService.selectAutomobileEnterpriseById(id));
return R.ok(automobileEnterpriseService.selectAutomobileEnterpriseById(request.getId()));
}
/**
......@@ -80,8 +79,8 @@ public class AutomobileEnterpriseController extends BaseController
*/
@ApiOperation("新增车企信息")
@Log(title = "车企信息", businessType = BusinessType.INSERT)
@PostMapping
public R add(@RequestBody AutomobileEnterprise automobileEnterprise)
@PostMapping("/add")
public R<Integer> add(@RequestBody AutomobileEnterprise automobileEnterprise)
{
return R.ok(automobileEnterpriseService.insertAutomobileEnterprise(automobileEnterprise));
}
......@@ -91,8 +90,8 @@ public class AutomobileEnterpriseController extends BaseController
*/
@ApiOperation("修改车企信息")
@Log(title = "车企信息", businessType = BusinessType.UPDATE)
@PutMapping
public R edit(@RequestBody AutomobileEnterprise automobileEnterprise)
@PostMapping("/edit")
public R<Integer> edit(@RequestBody AutomobileEnterprise automobileEnterprise)
{
return R.ok(automobileEnterpriseService.updateAutomobileEnterprise(automobileEnterprise));
}
......@@ -102,9 +101,9 @@ public class AutomobileEnterpriseController extends BaseController
*/
@ApiOperation("删除车企信息")
@Log(title = "车企信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public R remove(@PathVariable Long[] ids)
@PostMapping("/remove")
public R<Integer> remove(@Validated @RequestBody AutomobileEnterpriseRequest request)
{
return R.ok(automobileEnterpriseService.deleteAutomobileEnterpriseByIds(ids));
return R.ok(automobileEnterpriseService.deleteAutomobileEnterpriseByIds(request.getIds()));
}
}
package com.ruoyi.web.request;
import com.ruoyi.common.core.page.PageDomain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 车企信息DTO
* @author gxk
*/
@Data
@ApiModel
public class AutomobileEnterpriseRequest extends PageDomain {
@ApiModelProperty("ID")
private Long id;
@ApiModelProperty("车企ID集合")
private Long[] ids;
}
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