企业列表出来了
parent
f277a1a343
commit
c87467a824
|
@ -6,6 +6,11 @@
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="72651396-d9d2-4022-b080-e21d75d1bedb" name="更改" comment="企业列表出来了">
|
<list default="true" id="72651396-d9d2-4022-b080-e21d75d1bedb" name="更改" comment="企业列表出来了">
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/cloud-market-server/src/main/java/com/muyu/market/controller/MyApiController.java" beforeDir="false" afterPath="$PROJECT_DIR$/cloud-market-server/src/main/java/com/muyu/market/controller/MyApiController.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/cloud-market-server/src/main/java/com/muyu/market/mapper/MyApiMapper.java" beforeDir="false" afterPath="$PROJECT_DIR$/cloud-market-server/src/main/java/com/muyu/market/mapper/MyApiMapper.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/cloud-market-server/src/main/java/com/muyu/market/service/IMyApiService.java" beforeDir="false" afterPath="$PROJECT_DIR$/cloud-market-server/src/main/java/com/muyu/market/service/IMyApiService.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/cloud-market-server/src/main/java/com/muyu/market/service/impl/MyApiServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/cloud-market-server/src/main/java/com/muyu/market/service/impl/MyApiServiceImpl.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/cloud-market-server/src/main/resources/mapper/market/MyApiMapper.xml" beforeDir="false" afterPath="$PROJECT_DIR$/cloud-market-server/src/main/resources/mapper/market/MyApiMapper.xml" afterDir="false" />
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
|
@ -180,6 +185,7 @@
|
||||||
<workItem from="1725553138436" duration="1569000" />
|
<workItem from="1725553138436" duration="1569000" />
|
||||||
<workItem from="1725584707555" duration="7589000" />
|
<workItem from="1725584707555" duration="7589000" />
|
||||||
<workItem from="1725605672086" duration="3347000" />
|
<workItem from="1725605672086" duration="3347000" />
|
||||||
|
<workItem from="1725621072988" duration="3535000" />
|
||||||
</task>
|
</task>
|
||||||
<task id="LOCAL-00001" summary="初始化">
|
<task id="LOCAL-00001" summary="初始化">
|
||||||
<created>1724047244829</created>
|
<created>1724047244829</created>
|
||||||
|
@ -489,7 +495,14 @@
|
||||||
<option name="project" value="LOCAL" />
|
<option name="project" value="LOCAL" />
|
||||||
<updated>1725610965944</updated>
|
<updated>1725610965944</updated>
|
||||||
</task>
|
</task>
|
||||||
<option name="localTasksCounter" value="45" />
|
<task id="LOCAL-00045" summary="企业列表出来了">
|
||||||
|
<created>1725621190899</created>
|
||||||
|
<option name="number" value="00045" />
|
||||||
|
<option name="presentableId" value="LOCAL-00045" />
|
||||||
|
<option name="project" value="LOCAL" />
|
||||||
|
<updated>1725621190899</updated>
|
||||||
|
</task>
|
||||||
|
<option name="localTasksCounter" value="46" />
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
<component name="TypeScriptGeneratedFilesManager">
|
<component name="TypeScriptGeneratedFilesManager">
|
||||||
|
|
|
@ -35,6 +35,16 @@ public class MyApiController extends BaseController
|
||||||
@Resource
|
@Resource
|
||||||
private IMyApiService myApiService;
|
private IMyApiService myApiService;
|
||||||
|
|
||||||
|
@PostMapping("/upd")
|
||||||
|
public Result updByUserIdAndApiId(@RequestBody MyApi myApi) {
|
||||||
|
if(myApi.getMyNum()==0){
|
||||||
|
return Result.error("次数不足");
|
||||||
|
}
|
||||||
|
Long userId = SecurityUtils.getUserId();
|
||||||
|
myApi.setUserId(userId);
|
||||||
|
return Result.success(myApiService.updByUserIdAndApiId(myApi));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询我的api列表
|
* 查询我的api列表
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -13,5 +13,5 @@ import org.apache.ibatis.annotations.Mapper;
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface MyApiMapper extends BaseMapper<MyApi>{
|
public interface MyApiMapper extends BaseMapper<MyApi>{
|
||||||
|
Integer updByUserIdAndApiId(MyApi myApi);
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,8 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
* @date 2024-09-06
|
* @date 2024-09-06
|
||||||
*/
|
*/
|
||||||
public interface IMyApiService extends IService<MyApi> {
|
public interface IMyApiService extends IService<MyApi> {
|
||||||
|
|
||||||
|
public Integer updByUserIdAndApiId(MyApi myApi);
|
||||||
/**
|
/**
|
||||||
* 精确查询我的api
|
* 精确查询我的api
|
||||||
*
|
*
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.muyu.market.service.impl;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.muyu.market.domain.SysDatawarehouse;
|
import com.muyu.market.domain.SysDatawarehouse;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.muyu.market.mapper.MyApiMapper;
|
import com.muyu.market.mapper.MyApiMapper;
|
||||||
import com.muyu.market.domain.MyApi;
|
import com.muyu.market.domain.MyApi;
|
||||||
|
@ -23,6 +24,13 @@ public class MyApiServiceImpl
|
||||||
extends ServiceImpl<MyApiMapper, MyApi>
|
extends ServiceImpl<MyApiMapper, MyApi>
|
||||||
implements IMyApiService {
|
implements IMyApiService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MyApiMapper mapper;
|
||||||
|
@Override
|
||||||
|
public Integer updByUserIdAndApiId(MyApi myApi) {
|
||||||
|
return mapper.updByUserIdAndApiId(myApi);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 精确查询我的api
|
* 精确查询我的api
|
||||||
*
|
*
|
||||||
|
|
|
@ -62,6 +62,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</trim>
|
</trim>
|
||||||
where my_id = #{myId}
|
where my_id = #{myId}
|
||||||
</update>
|
</update>
|
||||||
|
<update id="updByUserIdAndApiId">
|
||||||
|
UPDATE my_api SET `my_num` = my_num-1 <if test="myNum==1" >,`my_states` = 'N'</if> WHERE `user_id` = #{userId} and `api_id` = #{apiId};
|
||||||
|
</update>
|
||||||
|
|
||||||
<delete id="deleteMyApiByMyId" parameterType="Long">
|
<delete id="deleteMyApiByMyId" parameterType="Long">
|
||||||
delete from my_api where my_id = #{myId}
|
delete from my_api where my_id = #{myId}
|
||||||
|
|
Loading…
Reference in New Issue