chore: initialize qiming workspace repository
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
package com.xspaceagi.pricing.infra.dao.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TableName("model_price_tier")
|
||||
public class ModelPriceTier {
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
private Long modelId;
|
||||
|
||||
private Integer contextLength;
|
||||
|
||||
private BigDecimal inputPrice;
|
||||
|
||||
private BigDecimal outputPrice;
|
||||
|
||||
private BigDecimal cachePrice;
|
||||
|
||||
@TableField("_tenant_id")
|
||||
private Long tenantId;
|
||||
|
||||
private Date created;
|
||||
|
||||
private Date modified;
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.xspaceagi.pricing.infra.dao.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TableName("pricing_config")
|
||||
public class PricingConfig {
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
private String targetType;
|
||||
|
||||
private String targetId;
|
||||
|
||||
private String pricingType;
|
||||
|
||||
private BigDecimal price;
|
||||
|
||||
private Integer trialCount;
|
||||
|
||||
private Integer status;
|
||||
|
||||
private Long spaceId;
|
||||
|
||||
@TableField("_tenant_id")
|
||||
private Long tenantId;
|
||||
|
||||
private Date created;
|
||||
|
||||
private Date modified;
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.xspaceagi.pricing.infra.dao.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TableName("trial_record")
|
||||
public class TrialRecord {
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
private Long userId;
|
||||
|
||||
private String targetType;
|
||||
|
||||
private String targetId;
|
||||
|
||||
private Integer usedCount;
|
||||
|
||||
@TableField("_tenant_id")
|
||||
private Long tenantId;
|
||||
|
||||
private Date created;
|
||||
|
||||
private Date modified;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.xspaceagi.pricing.infra.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.xspaceagi.pricing.infra.dao.entity.ModelPriceTier;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface ModelPriceTierMapper extends BaseMapper<ModelPriceTier> {
|
||||
|
||||
List<ModelPriceTier> selectByModelId(@Param("modelId") Long modelId);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.xspaceagi.pricing.infra.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.xspaceagi.pricing.infra.dao.entity.PricingConfig;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface PricingConfigMapper extends BaseMapper<PricingConfig> {
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.xspaceagi.pricing.infra.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.xspaceagi.pricing.infra.dao.entity.TrialRecord;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface TrialRecordMapper extends BaseMapper<TrialRecord> {
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.xspaceagi.pricing.infra.dao.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.xspaceagi.pricing.infra.dao.entity.ModelPriceTier;
|
||||
|
||||
public interface IModelPriceTierService extends IService<ModelPriceTier> {
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.xspaceagi.pricing.infra.dao.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.xspaceagi.pricing.infra.dao.entity.PricingConfig;
|
||||
|
||||
public interface IPricingConfigService extends IService<PricingConfig> {
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.xspaceagi.pricing.infra.dao.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.xspaceagi.pricing.infra.dao.entity.TrialRecord;
|
||||
|
||||
public interface ITrialRecordService extends IService<TrialRecord> {
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.xspaceagi.pricing.infra.dao.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.xspaceagi.pricing.infra.dao.entity.ModelPriceTier;
|
||||
import com.xspaceagi.pricing.infra.dao.mapper.ModelPriceTierMapper;
|
||||
import com.xspaceagi.pricing.infra.dao.service.IModelPriceTierService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class ModelPriceTierServiceImpl extends ServiceImpl<ModelPriceTierMapper, ModelPriceTier> implements IModelPriceTierService {
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.xspaceagi.pricing.infra.dao.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.xspaceagi.pricing.infra.dao.entity.PricingConfig;
|
||||
import com.xspaceagi.pricing.infra.dao.mapper.PricingConfigMapper;
|
||||
import com.xspaceagi.pricing.infra.dao.service.IPricingConfigService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class PricingConfigServiceImpl extends ServiceImpl<PricingConfigMapper, PricingConfig> implements IPricingConfigService {
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.xspaceagi.pricing.infra.dao.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.xspaceagi.pricing.infra.dao.entity.TrialRecord;
|
||||
import com.xspaceagi.pricing.infra.dao.mapper.TrialRecordMapper;
|
||||
import com.xspaceagi.pricing.infra.dao.service.ITrialRecordService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class TrialRecordServiceImpl extends ServiceImpl<TrialRecordMapper, TrialRecord> implements ITrialRecordService {
|
||||
}
|
||||
@@ -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.xspaceagi.pricing.infra.dao.mapper.ModelPriceTierMapper">
|
||||
|
||||
<select id="selectByModelId" resultType="com.xspaceagi.pricing.infra.dao.entity.ModelPriceTier">
|
||||
SELECT * FROM model_price_tier
|
||||
WHERE model_id = #{modelId}
|
||||
ORDER BY context_length ASC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user