Compare commits
4 Commits
3f47dd75ec
...
80689b1cab
Author | SHA1 | Date |
---|---|---|
|
80689b1cab | |
|
60fcd376d3 | |
|
f7139370eb | |
|
992edec5fd |
|
@ -18,7 +18,7 @@ public class Connector {
|
||||||
/**
|
/**
|
||||||
* id
|
* id
|
||||||
*/
|
*/
|
||||||
private Integer connectorId;
|
private Long connectorId;
|
||||||
/**
|
/**
|
||||||
* 接口名称
|
* 接口名称
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,13 +1,11 @@
|
||||||
package com.muyu.cloud.mart.controller;
|
package com.muyu.cloud.mart.controller;
|
||||||
|
|
||||||
|
import com.dtflys.forest.annotation.Post;
|
||||||
import com.muyu.cloud.mart.service.ConnectorService;
|
import com.muyu.cloud.mart.service.ConnectorService;
|
||||||
import com.muyu.common.core.domain.Result;
|
import com.muyu.common.core.domain.Result;
|
||||||
import com.muyu.domain.Connector;
|
import com.muyu.domain.Connector;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author:chaiyapeng
|
* @Author:chaiyapeng
|
||||||
|
@ -31,4 +29,25 @@ public class ConnectorController {
|
||||||
public Result findConnectorList(@RequestBody Connector connector){
|
public Result findConnectorList(@RequestBody Connector connector){
|
||||||
return connectorService.findConnectorList(connector);
|
return connectorService.findConnectorList(connector);
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 接口添加
|
||||||
|
*/
|
||||||
|
@PostMapping("addConnector")
|
||||||
|
public Result addConnector(@RequestBody Connector connector){
|
||||||
|
return connectorService.addConnector(connector);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 接口修改
|
||||||
|
*/
|
||||||
|
@PostMapping("updateConnector")
|
||||||
|
public Result updateConnector(@RequestBody Connector connector){
|
||||||
|
return connectorService.updateConnector(connector);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 接口删除
|
||||||
|
*/
|
||||||
|
@GetMapping("getDeleteConnector")
|
||||||
|
public Result getDeleteConnector(@RequestParam(name = "connectorId") Long connectorId){
|
||||||
|
return connectorService.getDeleteConnector(connectorId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,4 +13,5 @@ import org.apache.ibatis.annotations.Mapper;
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface ConnectorMapper extends BaseMapper<Connector> {
|
public interface ConnectorMapper extends BaseMapper<Connector> {
|
||||||
|
int getDeleteConnector(Long connectorId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,4 +14,10 @@ import com.muyu.domain.Connector;
|
||||||
public interface ConnectorService extends IService<Connector> {
|
public interface ConnectorService extends IService<Connector> {
|
||||||
|
|
||||||
Result findConnectorList(Connector connector);
|
Result findConnectorList(Connector connector);
|
||||||
|
|
||||||
|
Result updateConnector(Connector connector);
|
||||||
|
|
||||||
|
Result addConnector(Connector connector);
|
||||||
|
|
||||||
|
Result getDeleteConnector(Long connectorId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.muyu.cloud.mart.service.impl;
|
package com.muyu.cloud.mart.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.muyu.cloud.mart.mapper.ConnectorMapper;
|
import com.muyu.cloud.mart.mapper.ConnectorMapper;
|
||||||
|
@ -9,6 +10,7 @@ import com.muyu.domain.Connector;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -36,4 +38,33 @@ public class ConnectorServiceImpl extends ServiceImpl<ConnectorMapper, Connector
|
||||||
List<Connector> connectors = connectorMapper.selectList(wrapper);
|
List<Connector> connectors = connectorMapper.selectList(wrapper);
|
||||||
return Result.success(connectors);
|
return Result.success(connectors);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result updateConnector(Connector connector) {
|
||||||
|
connector.setConnectorTime(new Date());
|
||||||
|
Integer i = connectorMapper.updateById(connector);
|
||||||
|
if (i>0){
|
||||||
|
return Result.success(i,"更新成功");
|
||||||
|
}
|
||||||
|
return Result.error("更新失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result addConnector(Connector connector) {
|
||||||
|
connector.setConnectorTime(new Date());
|
||||||
|
Integer i = connectorMapper.insert(connector);
|
||||||
|
if (i>0){
|
||||||
|
return Result.success(i,"添加成功");
|
||||||
|
}
|
||||||
|
return Result.error("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result getDeleteConnector(Long connectorId) {
|
||||||
|
Integer i = this.connectorMapper.getDeleteConnector(connectorId);
|
||||||
|
if (i>0){
|
||||||
|
return Result.success(i,"删除成功");
|
||||||
|
}
|
||||||
|
return Result.error("删除失败");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.muyu.cloud.mart.mapper.ConnectorMapper">
|
||||||
|
|
||||||
|
|
||||||
|
<select id="getDeleteConnector" resultType="java.lang.Integer">
|
||||||
|
delete from connector where connector_id=#{connectorId}
|
||||||
|
</select>
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue