Skip to content

Commit

Permalink
feat: update log tail param
Browse files Browse the repository at this point in the history
  • Loading branch information
wtt40122 committed Jul 6, 2023
1 parent 92d4b9e commit 19586ef
Show file tree
Hide file tree
Showing 12 changed files with 96 additions and 96 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import com.xiaomi.mone.log.api.enums.ProjectTypeEnum;
import com.xiaomi.mone.log.manager.dao.MilogLogTailDao;
import com.xiaomi.mone.log.manager.dao.MilogLogstoreDao;
import com.xiaomi.mone.log.manager.model.bo.MilogLogtailParam;
import com.xiaomi.mone.log.manager.model.bo.LogTailParam;
import com.xiaomi.mone.log.manager.model.bo.MlogParseParam;
import com.xiaomi.mone.log.manager.model.pojo.MilogLogStoreDO;
import com.xiaomi.mone.log.manager.model.pojo.MilogLogTailDo;
Expand Down Expand Up @@ -47,7 +47,7 @@ public class HeraConfigValid {
@Resource
private MilogLogTailDao milogLogtailDao;

public String verifyLogTailParam(MilogLogtailParam param) {
public String verifyLogTailParam(LogTailParam param) {
if (null == param.getMilogAppId()) {
return "选择的应用不能为空";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import com.xiaomi.mone.log.common.Result;
import com.xiaomi.mone.log.manager.model.MilogSpaceParam;
import com.xiaomi.mone.log.manager.model.bo.BatchQueryParam;
import com.xiaomi.mone.log.manager.model.bo.MilogLogtailParam;
import com.xiaomi.mone.log.manager.model.bo.LogTailParam;
import com.xiaomi.mone.log.manager.model.bo.MlogParseParam;
import com.xiaomi.mone.log.manager.model.dto.*;
import com.xiaomi.mone.log.manager.model.page.PageInfo;
Expand Down Expand Up @@ -163,22 +163,22 @@ public Result<List<Map<String, String>>> getStoreIps(@RequestParam("storeId") Lo
* ********* milogLogtail **********
*/
@RequestMapping(path = "/milog/tail/new")
public Result<MilogTailDTO> newMilogLogtail(@RequestParam("param") MilogLogtailParam param) {
public Result<LogTailDTO> newMilogLogtail(@RequestParam("param") LogTailParam param) {
return logTailService.newMilogLogTail(param);
}

@RequestMapping(path = "/milog/tail/getbyid", method = "get")
public Result<MilogTailDTO> getMilogLogtailById(@RequestParam("id") Long id) {
public Result<LogTailDTO> getMilogLogtailById(@RequestParam("id") Long id) {
return logTailService.getMilogLogtailById(id);
}

@RequestMapping(path = "/milog/tail/getbyids", method = "get")
public Result<List<MilogTailDTO>> getMilogLogtailByIds(@RequestParam("ids") List<Long> ids) {
public Result<List<LogTailDTO>> getMilogLogtailByIds(@RequestParam("ids") List<Long> ids) {
return logTailService.getMilogLogtailByIds(ids);
}

@RequestMapping(path = "/milog/tail/getbyStoreId", method = "get")
public Result<List<MilogTailDTO>> getTailByStoreId(@RequestParam("storeId") Long storeId) {
public Result<List<LogTailDTO>> getTailByStoreId(@RequestParam("storeId") Long storeId) {
return logTailService.getTailByStoreId(storeId);
}

Expand All @@ -195,7 +195,7 @@ public Result<Map<String, Object>> getMilogLogTailCountByStoreId(@RequestParam("
}

@RequestMapping(path = "/milog/tail/update")
public Result<Void> updateMilogLogTail(MilogLogtailParam param) {
public Result<Void> updateMilogLogTail(LogTailParam param) {
return logTailService.updateMilogLogTail(param);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public class MilogLogTailDao {
@Resource
private NutDao dao;

public MilogLogTailDo newMilogLogtail(MilogLogTailDo mt) {
public MilogLogTailDo add(MilogLogTailDo mt) {
return dao.insert(mt);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class MilogLogtailParam {
public class LogTailParam {
private Long id;
private Long spaceId;
private Long storeId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/
package com.xiaomi.mone.log.manager.model.convert;

import com.xiaomi.mone.log.manager.model.bo.MilogLogtailParam;
import com.xiaomi.mone.log.manager.model.dto.MilogTailDTO;
import com.xiaomi.mone.log.manager.model.bo.LogTailParam;
import com.xiaomi.mone.log.manager.model.dto.LogTailDTO;
import com.xiaomi.mone.log.manager.model.pojo.MilogLogTailDo;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
Expand All @@ -25,7 +25,7 @@
public interface MilogLogtailConvert {
MilogLogtailConvert INSTANCE = Mappers.getMapper(MilogLogtailConvert.class);

MilogTailDTO fromDO(MilogLogTailDo milogLogtailDo);
LogTailDTO fromDO(MilogLogTailDo milogLogtailDo);

MilogLogTailDo fromDo(MilogLogtailParam milogLogtailParam);
MilogLogTailDo fromDo(LogTailParam logTailParam);
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import java.util.List;

@Data
public class MilogTailDTO {
public class LogTailDTO {
private Long id;
private Long ctime;
private Long utime;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import com.xiaomi.mone.app.model.vo.HeraEnvIpVo;
import com.xiaomi.mone.log.api.enums.LogStructureEnum;
import com.xiaomi.mone.log.common.Result;
import com.xiaomi.mone.log.manager.model.bo.MilogLogtailParam;
import com.xiaomi.mone.log.manager.model.bo.LogTailParam;
import com.xiaomi.mone.log.manager.model.bo.MlogParseParam;
import com.xiaomi.mone.log.manager.model.dto.*;
import com.xiaomi.mone.log.manager.model.pojo.MilogLogStoreDO;
Expand All @@ -31,11 +31,11 @@

public interface LogTailService {

Result<MilogTailDTO> newMilogLogTail(MilogLogtailParam param);
Result<LogTailDTO> newMilogLogTail(LogTailParam param);

void sengMessageNewTail(MilogLogtailParam param, MilogLogTailDo milogLogtailDo, MilogLogStoreDO milogLogStore);
void sengMessageNewTail(LogTailParam param, MilogLogTailDo milogLogtailDo, MilogLogStoreDO milogLogStore);

MilogLogTailDo buildLogTailDo(MilogLogtailParam param, MilogLogStoreDO milogLogStore, AppBaseInfo appBaseInfo, String creator);
MilogLogTailDo buildLogTailDo(LogTailParam param, MilogLogStoreDO milogLogStore, AppBaseInfo appBaseInfo, String creator);

void sengMessageToAgent(Long milogAppId, MilogLogTailDo logtailDo);

Expand All @@ -54,15 +54,15 @@ public interface LogTailService {
*/
boolean deleteConfigRemote(Long spaceId, Long id, String motorRoomEn, LogStructureEnum logStructureEnum);

Result<MilogTailDTO> getMilogLogtailById(Long id);
Result<LogTailDTO> getMilogLogtailById(Long id);

Result<Map<String, Object>> getMilogLogBypage(Long storeId, int page, int pagesize);

Result<Map<String, Object>> getLogTailCountByStoreId(Long storeId);

Result<List<MilogTailDTO>> getMilogLogtailByIds(List<Long> ids);
Result<List<LogTailDTO>> getMilogLogtailByIds(List<Long> ids);

Result<Void> updateMilogLogTail(MilogLogtailParam param);
Result<Void> updateMilogLogTail(LogTailParam param);

Result<Void> deleteMilogLogTail(Long id);

Expand All @@ -89,15 +89,15 @@ public interface LogTailService {
*/
void dockerScaleDynamic(DockerScaleBo projectInfo);

MilogTailDTO milogLogtailDO2DTO(MilogLogTailDo milogLogtailDo);
LogTailDTO milogLogtailDO2DTO(MilogLogTailDo milogLogtailDo);

Result<List<MapDTO>> queryAppByStoreId(Long storeId);

Result<List<AppTypeTailDTO>> queryAppTailByStoreId(Long storeId);

Result<List<MilogLogStoreDO>> queryLogStoreByRegionEn(String nameEn);

Result<List<MilogTailDTO>> getTailByStoreId(Long storeId);
Result<List<LogTailDTO>> getTailByStoreId(Long storeId);

Result<Object> parseScriptTest(MlogParseParam mlogParseParam);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import com.xiaomi.mone.app.api.response.AppBaseInfo;
import com.xiaomi.mone.log.api.enums.OperateEnum;
import com.xiaomi.mone.log.api.enums.ProjectTypeEnum;
import com.xiaomi.mone.log.manager.model.bo.MilogLogtailParam;
import com.xiaomi.mone.log.manager.model.bo.LogTailParam;
import com.xiaomi.mone.log.manager.model.dto.MilogAppEnvDTO;
import com.xiaomi.mone.log.manager.model.pojo.MilogLogStoreDO;
import com.xiaomi.mone.log.manager.model.pojo.MilogLogTailDo;
Expand Down Expand Up @@ -66,7 +66,7 @@ public class DefaultTailExtensionService implements TailExtensionService {
private MilogAgentServiceImpl milogAgentService;

@Override
public boolean tailHandlePreprocessingSwitch(MilogLogStoreDO milogLogStore, MilogLogtailParam param) {
public boolean tailHandlePreprocessingSwitch(MilogLogStoreDO milogLogStore, LogTailParam param) {
return true;
}

Expand Down Expand Up @@ -96,7 +96,7 @@ public void defaultBindingAppTailConfigRelPostProcess(Long spaceId, Long storeId
}

@Override
public void sendMessageOnCreate(MilogLogtailParam param, MilogLogTailDo mt, Long milogAppId, boolean supportedConsume) {
public void sendMessageOnCreate(LogTailParam param, MilogLogTailDo mt, Long milogAppId, boolean supportedConsume) {
/**
* 发送配置信息---log-agent
*/
Expand Down Expand Up @@ -127,7 +127,7 @@ public void updateSendMsg(MilogLogTailDo milogLogtailDo, List<String> oldIps, bo
}

@Override
public void logTailDoExtraFiled(MilogLogTailDo milogLogtailDo, MilogLogStoreDO logStoreDO, MilogLogtailParam logTailParam) {
public void logTailDoExtraFiled(MilogLogTailDo milogLogtailDo, MilogLogStoreDO logStoreDO, LogTailParam logTailParam) {
milogLogtailDo.setIps(logTailParam.getIps());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package com.xiaomi.mone.log.manager.service.extension.tail;

import com.xiaomi.mone.app.api.response.AppBaseInfo;
import com.xiaomi.mone.log.manager.model.bo.MilogLogtailParam;
import com.xiaomi.mone.log.manager.model.bo.LogTailParam;
import com.xiaomi.mone.log.manager.model.dto.MilogAppEnvDTO;
import com.xiaomi.mone.log.manager.model.pojo.MilogLogStoreDO;
import com.xiaomi.mone.log.manager.model.pojo.MilogLogTailDo;
Expand All @@ -34,7 +34,7 @@
public interface TailExtensionService {
String DEFAULT_TAIL_EXTENSION_SERVICE_KEY = "defaultTailExtensionService";

boolean tailHandlePreprocessingSwitch(MilogLogStoreDO milogLogStore, MilogLogtailParam param);
boolean tailHandlePreprocessingSwitch(MilogLogStoreDO milogLogStore, LogTailParam param);

boolean bindMqResourceSwitch(Integer appType);

Expand All @@ -46,11 +46,11 @@ public interface TailExtensionService {

void defaultBindingAppTailConfigRelPostProcess(Long spaceId, Long storeId, Long tailId, Long milogAppId, Long storeMqResourceId);

void sendMessageOnCreate(MilogLogtailParam param, MilogLogTailDo mt, Long milogAppId, boolean supportedConsume);
void sendMessageOnCreate(LogTailParam param, MilogLogTailDo mt, Long milogAppId, boolean supportedConsume);

void updateSendMsg(MilogLogTailDo milogLogtailDo, List<String> oldIps, boolean supportedConsume);

void logTailDoExtraFiled(MilogLogTailDo milogLogtailDo, MilogLogStoreDO logStoreDO, MilogLogtailParam logTailParam);
void logTailDoExtraFiled(MilogLogTailDo milogLogtailDo, MilogLogStoreDO logStoreDO, LogTailParam logTailParam);

void logTailConfigExtraField(LogtailConfig logtailConfig, MilogMiddlewareConfig middlewareConfig);

Expand Down
Loading

0 comments on commit 19586ef

Please sign in to comment.