-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from san5167/main
crawling copyright flag and crawling license
- Loading branch information
Showing
29 changed files
with
1,026 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FROM golang:alpine | ||
WORKDIR /app | ||
COPY . . | ||
RUN go mod tidy | ||
RUN go build -o webnotice_toolbox ./webnotice-scanner/main.go | ||
CMD ["./webnotice_toolbox"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: webnotice-toolbox-config | ||
data: | ||
addr: ":9000" | ||
dsn: "dataset:dataset@tcp(localhost:3306)/opendataology?charset=utf8mb4&parseTime=True&loc=Local" | ||
max_idle_conn: "100" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: portal-backend-deployment | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: | ||
strategy: | ||
type: Recreate | ||
template: | ||
metadata: | ||
labels: | ||
app: webnotice-toolbox | ||
spec: | ||
containers: | ||
- image: robekeane/webnotice-toolbox:0.1 | ||
name: webnotice-toolbox-con | ||
env: | ||
- name: ADDR | ||
valueFrom: | ||
configMapKeyRef: | ||
name: webnotice-toolbox-config | ||
key: addr | ||
- name: DSN | ||
valueFrom: | ||
configMapKeyRef: | ||
name: webnotice-toolbox-config | ||
key: dsn | ||
- name: MAX_IDLE_CONN | ||
valueFrom: | ||
configMapKeyRef: | ||
name: webnotice-toolbox-config | ||
key: max_idle_conn | ||
- name: TOKEN | ||
valueFrom: | ||
configMapKeyRef: | ||
name: webnotice-toolbox-config | ||
key: token |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: webnotice-toolbox-service | ||
labels: | ||
app: webnotice-toolbox | ||
spec: | ||
type: NodePort | ||
selector: | ||
app: webnotice-toolbox | ||
ports: | ||
- protocol: TCP | ||
nodePort: 30902 | ||
port: 9000 | ||
targetPort: 9000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
CREATE TABLE t_license_url_suffix( | ||
id INT AUTO_INCREMENT PRIMARY KEY COMMENt "ID", | ||
url_suffix VARCHAR(1023) NOT NULL COMMENT "license_url suffix" | ||
)ENGINE=InnoDB CHARSET=utf8mb4 | ||
|
||
CREATE TABLE t_source_web_page_license_keyword( | ||
id INT AUTO_INCREMENT PRIMARY KEY COMMENt "ID", | ||
keyword VARCHAR(1023) NOT NULL COMMENT "license link in webpage keyword" | ||
)ENGINE=InnoDB CHARSET=utf8mb4 | ||
|
||
|
||
|
||
CREATE TABLE t_source_web_page_copyright_keyword( | ||
id INT AUTO_INCREMENT PRIMARY KEY COMMENt "ID", | ||
keyword VARCHAR(1023) NOT NULL COMMENT "copyrignt flag keyword" | ||
)ENGINE=InnoDB CHARSET=utf8mb4 | ||
|
||
|
||
CREATE TABLE `t_license_mes` ( | ||
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID', | ||
`license_name` varchar(1023) NOT NULL COMMENT 'license name', | ||
`license_url` varchar(1023) NOT NULL COMMENT 'license url', | ||
`license_type` int(11) DEFAULT NULL COMMENT 'license type 10:data license 20:specific license 30:TOU', | ||
`copyright_flag` varchar(1023) NOT NULL COMMENT 'copyrigt flag in webpage', | ||
`licensor` varchar(1023) NOT NULL COMMENT 'licenseor', | ||
`license_content` longtext COMMENT 'license content', | ||
`source_url` varchar(1023) DEFAULT NULL COMMENT 'source url', | ||
`aibom_id` int(11) DEFAULT NULL, | ||
PRIMARY KEY (`id`) | ||
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package database | ||
|
||
import ( | ||
"gorm.io/driver/mysql" | ||
"gorm.io/gorm" | ||
) | ||
|
||
var DB *gorm.DB | ||
|
||
func InitDB(dsn string) (*gorm.DB, error) { | ||
//conf := Get() | ||
db, err := gorm.Open(mysql.Open(dsn), &gorm.Config{}) | ||
|
||
if err == nil { | ||
DB = db | ||
return db, err | ||
} | ||
return nil, err | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.