Skip to content

niubir/area-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

English | 简体中文

What is area service

Area service is administrative region code service.

Based on Amap Implementation.

Quick start

Configure

config.yml

mode: TEST
debug: true
amapKey: <set you amap key>
autoFreshTime: 00:00:00
http:
  enable: true
  port: 10011
grpc:
  enable: true
  port: 10012

Run by Golang

git clone https://github.com/niubir/area-service && cd area-service
CONFIG_DIR='you config.yml path' go run main.go

Run by Docker

docker pull niubir/area-service:latest
docker run -p 10011:10011 -p 10012:10012 -v <you config.yml path>/config:/config -d niubir/area-service:latest

Usage

http

swgger http://localhost:10011/swagger/index.html

grpc

proto https://github.com/niubir/area-service/blob/main/grpc/area.proto

cli

git clone https://github.com/niubir/area-service-client

Configuration option(config.yml)

Option Default Description
mode PRODUCTION system mode(PRODUCTION,TEST,DEVELOPMENT)
logLevel false log level(DEBUG,INFO,WARN,ERROR)
amapKey - Amap App
autoFreshTime - at what time does the automatic fresh of area every day, for example:00:00:00
http.enable true enable http
http.debug false enable http debug
http.port 10011 http port
grpc.enable true enable grpc
grpc.debug false enable grpc debug
grpc.port 10012 grpc port

Env option

Option Default Description
CONFIG_DIR /config config dir
CONFIG_FILENAME config.yml config filename
LOG_DIR /logs log dir
AREA_DIR /data area dir