Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Spring + lire to search the configuration by graph

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

1. Configure the java environment:

Apt-get install update

Apt-get install default-jre

Apt-get install default-jdk

Configure JAVA_HOME environment variables

Check the java installation path: update-alternatives-- config java

Vi / etc/environment

At the end of the document, add:

JAVA_HOME= "/ usr/lib/jvm/java-7-oracle"

2. Configuration file modification

Configuration file directory: src/main/resources

Application.properties

Spring.profiles.active

Specify which of the appplication-xxx.properties is used as the spring configuration file, swap is used by default for developers, and publish is generally used on official servers

Page.defaultPageSize

The number of goods returned by API API

Score.max

The commodity value with the farthest similarity in the interface, the larger the value, the less similar it is. Generally, 10-15 is suitable.

Spring.datasource.xxx.xxx

Spring data source configuration, that is, database-related parameters (the database connection is modified in the configuration file below)

Image index file path, please make sure you have read and write permissions

Application-xxx.properties

Local.lire.basePath

Image index file path, please make sure you have read and write permissions

Local.db.xxx.url

Database server connection string (ip port database)

Local.db.xxx.username

Database server user name

Local.db.xxx.password

Database server password

Database entity class modification

File directory: src/main/java/bean/sg

Generally, a table corresponds to a class.

ZProduct.java

The commodity table of the picture needs to be generated.

The table name corresponding to the @ table class

Primary key field in @ Id table name

@ Column field name

Database operation class modification

File directory: src/main/java/dao/sg

ZProductDao

The operations on the database are all in that class, which generally corresponds to the entity class one by one.

@ Query query statement

Variable parameters in @ Param query statement

GetAllProductId reads all goods Id

GetNewProduct reads the Id of all new items (items larger than the maximum Id read last time)

/ / the above main configuration database connections and tables, as well as id, picture address fields

3. Create an index storage directory to ensure that it is writable

Lire.indexPath = ${local.lire.basePath} / index-tk

Lire.index.all= ${local.lire.basePath} / index-all

Lire.index.tk = ${local.lire.basePath} / index-tk

Lire.index.bk = ${local.lire.basePath} / index-bk

4. Compile with gradlew

. / gradlew jar

Copy spring-lire/build/libs/spring-lire-0.0.1.jar to spring-lire/lib after compilation

5. Create an index

Spring-lire/bin/start.sh # start the service

Spring-lire/bin/cron_sync.sh # generates all indexes

Spring-lire/bin/cron_sync_add.sh # generate incremental index

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report