Skip to content

feat: add kakao channel, template, and brand template management#5

Merged
Palbahngmiyine merged 3 commits intomainfrom
worktree-prancy-humming-quiche
Apr 15, 2026
Merged

feat: add kakao channel, template, and brand template management#5
Palbahngmiyine merged 3 commits intomainfrom
worktree-prancy-humming-quiche

Conversation

@Palbahngmiyine
Copy link
Copy Markdown
Member

Summary

  • 카카오 비즈니스 채널 조회 (kakao channel — list/get/categories)
  • 카카오 채널 그룹 조회 (kakao channel-group — list/get, 소속 채널 포함)
  • 알림톡 템플릿 전체 관리 (kakao template — list/get/create/update/delete/inspect/cancel-inspect/sendable/categories/release-dormant)
  • 브랜드 템플릿 CRUD (kakao brand-template — list/create/update/delete/sendable)
  • 모든 list 커맨드에 cursor 기반 페이지네이션 (--start-key, --limit) 및 다음 페이지 안내
  • 보안 필드(senderKeys, groupKeys) 응답 타입에서 제외
  • 30개 파일, 83개 테스트 (race detection 통과)

Test plan

  • go test ./cmd/ -run TestKakaoChannel -count=1 — 채널/채널 그룹 테스트
  • go test ./cmd/ -run TestKakaoTemplate -count=1 — 알림톡 템플릿 테스트
  • go test ./cmd/ -run TestKakaoBrandTemplate -count=1 — 브랜드 템플릿 테스트
  • go test ./pkg/types/ -run TestKakao -count=1 — 타입 테스트
  • go test ./cmd/ -run TestKakao -race -count=1 — race detection
  • go build ./... — 빌드 성공
  • go vet ./... — 정적 분석 통과

🤖 Generated with Claude Code

…ands

Add comprehensive Kakao business channel inquiry, alimtalk template
management, and brand template management to the CLI. This enables
users to manage their Kakao messaging resources directly from solactl.

New command groups:
- `solactl kakao channel` (list/get/categories) — channel inquiry
- `solactl kakao channel-group` (list/get) — channel group inquiry
- `solactl kakao template` (list/get/create/update/delete/inspect/
  cancel-inspect/sendable/categories/release-dormant) — full alimtalk
  template lifecycle
- `solactl kakao brand-template` (list/create/update/delete/sendable)
  — brand template CRUD

All list commands support cursor-based pagination with --start-key and
--limit flags. Sensitive fields (senderKeys, groupKeys) are excluded
from response types. 83 tests covering success/failure/pagination/XOR
validation/delete confirmation paths.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request implements a comprehensive suite of CLI commands for managing KakaoTalk channels, channel groups, alimtalk templates, and brand templates, including full CRUD support and inspection workflows. Feedback focuses on resolving compilation errors caused by an undefined stdinReader variable in deletion commands, ensuring consistent output behavior by removing redundant JSON printing in creation commands, and refining the brand template update logic to correctly handle optional JSON fields.


if !kakaoBtplDeleteFlagYes {
_, _ = fmt.Fprintf(out(), "\u26a0 브랜드 템플릿 %s을 삭제하시겠습니까? (y/N): ", brandTemplateID)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

stdinReader 변수가 cmd 패키지 내의 비-테스트 파일 어디에도 정의되어 있지 않습니다. 이로 인해 컴파일 오류("undefined: stdinReader")가 발생합니다. 테스트 시 입력을 모킹하기 위한 용도라면 cmd/root.go 등에 패키지 수준 변수로 선언해야 합니다.

func runKakaoTemplateDelete(cmd *cobra.Command, args []string) error {
templateID := args[0]

if !kakaoTplDeleteFlagYes {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

stdinReader 변수가 cmd 패키지 내의 비-테스트 파일 어디에도 정의되어 있지 않습니다. 이로 인해 컴파일 오류("undefined: stdinReader")가 발생합니다. 테스트 시 입력을 모킹하기 위한 용도라면 cmd/root.go 등에 패키지 수준 변수로 선언해야 합니다.

Comment thread cmd/kakao_brand_template_create.go Outdated
Comment on lines +145 to +146
_, _ = fmt.Fprintln(out(), "브랜드 템플릿이 생성되었습니다.")
return p.PrintJSON(raw)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

--json 플래그가 지정되지 않은 경우에도 생성된 리소스의 전체 JSON을 출력하고 있습니다. 이는 다른 커맨드들과 일관성이 없으며, 일반적인 텍스트 모드 출력으로는 부적절합니다. 성공 메시지만 출력하거나 p.PrintResult를 사용하여 플래그에 따라 출력을 제어하는 것이 좋습니다.

Suggested change
_, _ = fmt.Fprintln(out(), "브랜드 템플릿이 생성되었습니다.")
return p.PrintJSON(raw)
_, _ = fmt.Fprintln(out(), "브랜드 템플릿이 생성되었습니다.")
return nil

Comment thread cmd/kakao_brand_template_update.go Outdated
Comment on lines +85 to +98
jsonFields := map[string]string{
"carousel": kakaoBtplUpdateFlagCarousel,
"mainWideItem": kakaoBtplUpdateFlagMainWideItem,
"subWideItemList": kakaoBtplUpdateFlagSubWideItemList,
"video": kakaoBtplUpdateFlagVideo,
"commerce": kakaoBtplUpdateFlagCommerce,
"buttons": kakaoBtplUpdateFlagButtons,
"coupon": kakaoBtplUpdateFlagCoupon,
}
for key, value := range jsonFields {
if err := setJSONField(body, key, value); err != nil {
return err
}
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

JSON 필드(carousel, video 등)를 업데이트할 때 cmd.Flags().Changed()를 확인하지 않고 루프를 통해 처리하고 있습니다. 또한 main-wide-item과 같이 플래그 이름과 JSON 키가 다른 경우에 대한 처리가 누락되어 있어 의도한 대로 동작하지 않을 수 있습니다. kakao_template_update.go와 같이 각 필드별로 Changed() 여부를 확인하여 명시적으로 처리하는 것이 안전합니다.

Comment thread cmd/kakao_template_create.go Outdated
Comment on lines +155 to +156
return p.PrintJSON(raw)
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

--json 플래그가 지정되지 않은 경우에도 생성된 리소스의 전체 JSON을 출력하고 있습니다. 이는 다른 커맨드들과 일관성이 없으며, 일반적인 텍스트 모드 출력으로는 부적절합니다. 성공 메시지만 출력하거나 p.PrintResult를 사용하여 플래그에 따라 출력을 제어하는 것이 좋습니다.

	_, _ = fmt.Fprintln(out(), "알림톡 템플릿이 생성되었습니다.")
	return nil

Palbahngmiyine and others added 2 commits April 15, 2026 16:40
- Fix double output in create commands (success message + raw JSON)
- Remove dead --channel-id/--channel-group-id flags from template
  update (API does not support changing channel via update)
- Gate brand-template update JSON fields on Changed state to prevent
  sending empty/default values for unspecified flags
- Replace variadic interface{} setIfChanged with typed
  setStringIfChanged and setJSONIfChanged helpers
- Replace custom contains/searchString with strings.Contains in tests

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Replace all interface{} with any in kakao command and test files
- Add resetPflagChanged helper to clear pflag Changed bits between
  tests, preventing order-dependent test failures in partial update
  scenarios

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Palbahngmiyine Palbahngmiyine merged commit d1164e0 into main Apr 15, 2026
2 checks passed
@Palbahngmiyine Palbahngmiyine deleted the worktree-prancy-humming-quiche branch April 16, 2026 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant