Study/Java2022. 5. 25. 18:31
Study/MySQL2022. 3. 23. 14:24

SELECT count(*) INTO @EXIST
FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME = 'column_name'
  AND TABLE_NAME = 'table_name' LIMIT 1;

SET @query = IF (@EXIST<= 0, 'ALTER TABLE `table_name`  ADD COLUMN `column_name` VARCHAR(100) NULL AFTER `isPublic`',
    'select \'column_name COLUMN EXISTS\' status');
PREPARE stmt FROM @query;
EXECUTE stmt;

Posted by 굥쓰
Study/Bookmark2021. 4. 7. 11:49
Study/Tip & Tech2021. 4. 1. 10:56

빌드 파일을 배포전에 특정 패턴의 이름 규칙으로 변경 후 배포하기 위해 후처리 스크립트 적용

물론 빌드 할때 알아서 원하는 이름으로 빌드하는게 좋지만, 직접 바꾸고 싶다면

아래 글을 참고하여 완성된 변경, 롤백 배치 파일 활용

FileRenameByPattern.bat
@echo off
Setlocal enabledelayedexpansion

Set "Pattern=KakaoGames"
Set "Replace=NcSoft"

For %%# in ("*.apk") Do (
    Set "File=%%~nx#"
    Ren "%%#" "!File:%Pattern%=%Replace%!"
)
FileRenameByPattern-rollback.bat
@echo off
Setlocal enabledelayedexpansion

Set "Pattern=NcSoft"
Set "Replace=KakaoGames"

For %%# in ("*.apk") Do (
    Set "File=%%~nx#"
    Ren "%%#" "!File:%Pattern%=%Replace%!"
)

 

How to rename file by replacing substring using batch in Windows

stackoverflow.com/questions/16128869/how-to-rename-file-by-replacing-substring-using-batch-in-windows/16128973

Posted by 굥쓰
Study/Bookmark2021. 2. 5. 17:21
Posted by 굥쓰
Study/Bookmark2021. 2. 5. 14:23
Study/Bookmark2021. 2. 3. 16:13
Posted by 굥쓰
Study/Bookmark2021. 2. 3. 16:09
Study/Tip & Tech2020. 10. 6. 14:30

1. 유휴 시간 확인 (변경 전)

cmd > net config server

유휴 세션 시간(분) 15 <= 15분

 

2. 자동 끊기 해제

cmd > net config server /autodisconnect:-1

 

3. 유휴 시간 확인 (변경 후)

cmd > net config server

유휴 세션 시간(분) -1

 

bigmark.tistory.com/82

 

네트워크 드라이브 연결 끊김 해결방안

네트워크 드라이브 연결 끊김 현상에대한 해결방안을 공유하고자 합니다. 현재 업무상 타PC에 대한 공유폴더를 생성하여 사용하고 있는데요. 네트워크 드라이브 연결끊김 현상이 자주 발생하�

bigmark.tistory.com

 

4. 네트워크 드라이버 연결 해제 및 강제 연결

net use M: /d

net use M: \\192.168.1.111\data "your_password" /user:your_id /persistent:no

Posted by 굥쓰
Study/ASP.NET MVC & Core2020. 9. 16. 14:33

API 구현 하면서 문서화에 대한 부분은 고민이 많은데 Swagger 를 적용하면 몇 라인의 코드 적용만으로도

문서화 및 디버깅까지 가능한 훌륭한 구조를 프로젝트에 포함 시킬 수 있는 장점이 있습니다.

 

1. 구현 미리보기

2. Nuget 패키지 관리에서 Swashbuckle.AspNetCore  추가

3. Startup.cs

        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddControllers();

            services.AddSwaggerGen(c => {

                // sepcify our operation filter here.  
                c.OperationFilter<AddCommonParameOperationFilter>();

                c.SwaggerDoc("api", new OpenApiInfo { Title = "Web API", Description = "WebAPI 사용법\r\nId : 43, charId : 282362182980730885"
                , Contact = new OpenApiContact { Name = "Minecraft", Email = string.Empty
                , Url = new Uri("http://localhost:1790") }
                });
            });
        }
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();

                app.UseSwagger();
                app.UseSwaggerUI(c => {
                    c.SwaggerEndpoint("api/swagger.json", "Api Documents");
                });
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
                app.UseHsts();
            }
        }

docs.microsoft.com/ko-kr/aspnet/core/tutorials/web-api-help-pages-using-swagger?view=aspnetcore-3.1

 

Swagger/OpenAPI를 사용한 ASP.NET Core Web API 도움말 페이지

이 자습서에서는 Swagger를 추가하여 Web API 앱에 대한 설명서 및 도움말 페이지를 생성하는 연습을 제공합니다.

docs.microsoft.com

 

4. 사용자 정의 Parameter 처리를 위한 클래스 추가

Web API 개발의 일반 적인 구조는 Entity 를 주고 받는 형태로 되어 있으므로 이 부분은 불필요 하지만

Entity 를 사용하지 않는 구조라면 고려할 만 합니다.

Custom 파라미터 적용을 위한 방법

https://www.c-sharpcorner.com/article/add-custom-parameters-in-swagger-using-asp-net-core-3-1/

 

Add Custom Parameters In Swagger Using ASP.NET Core 3.1

This article showed you a sample of how to add custom request parameters in Swagger using ASP.NET Core 3.1 and Swashbuckle.AspNetCore 5.0.0

www.c-sharpcorner.com

위 구조를 적용하고 나면 1번 미리보기 화면의 uId, charId 입력 파라미터 구조를 사용할 수 있습니다.

뚝딱뚝딱! MSDN 문서 뒤지고 구글링 해봐도 머리만 아팠는데 막상 적용하고 나니 깔끔하네요. ^ㅡ^

 

Posted by 굥쓰